summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2015-08-10 18:54:20 -0700
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2015-08-10 18:54:20 -0700
commitcfd31fe70203042bf50240bb8a268b1ac4fdb896 (patch)
tree800123974bce7c6f37b65f494411093e88210d88
parent356600eb4402bd4ff1dae364b7d7c9d3257749f8 (diff)
parentfda9229a426d9c0e4496c700099a7126da72ba64 (diff)
downloadcaffeonacl-cfd31fe70203042bf50240bb8a268b1ac4fdb896.tar.gz
caffeonacl-cfd31fe70203042bf50240bb8a268b1ac4fdb896.tar.bz2
caffeonacl-cfd31fe70203042bf50240bb8a268b1ac4fdb896.zip
Merge pull request #2873 from gut/master
Fix gist download model and binary scripts
-rwxr-xr-xscripts/download_model_binary.py2
-rwxr-xr-xscripts/download_model_from_gist.sh6
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/download_model_binary.py b/scripts/download_model_binary.py
index 48e9015f..03a50f67 100755
--- a/scripts/download_model_binary.py
+++ b/scripts/download_model_binary.py
@@ -32,7 +32,7 @@ def parse_readme_frontmatter(dirname):
with open(readme_filename) as f:
lines = [line.strip() for line in f.readlines()]
top = lines.index('---')
- bottom = lines[top + 1:].index('---')
+ bottom = lines.index('---', top + 1)
frontmatter = yaml.load('\n'.join(lines[top + 1:bottom]))
assert all(key in frontmatter for key in required_keys)
return dirname, frontmatter
diff --git a/scripts/download_model_from_gist.sh b/scripts/download_model_from_gist.sh
index a1dccf78..89527b75 100755
--- a/scripts/download_model_from_gist.sh
+++ b/scripts/download_model_from_gist.sh
@@ -18,7 +18,7 @@ fi
echo "Downloading Caffe model info to $MODEL_DIR ..."
mkdir -p $MODEL_DIR
-wget https://gist.github.com/$GIST/download -O $MODEL_DIR/gist.tar.gz
-tar xzf $MODEL_DIR/gist.tar.gz --directory=$MODEL_DIR --strip-components=1
-rm $MODEL_DIR/gist.tar.gz
+wget https://gist.github.com/$GIST/download -O $MODEL_DIR/gist.zip
+unzip -j $MODEL_DIR/gist.zip -d $MODEL_DIR
+rm $MODEL_DIR/gist.zip
echo "Done"