Skip to content

Instantly share code, notes, and snippets.

@ctodd
Created July 9, 2020 06:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ctodd/aa44e5750de1fe589289713771d3d559 to your computer and use it in GitHub Desktop.
!cd lib && git clone https://github.com/apache/incubator-mxnet.git
!aws s3 cp s3://$s3_output_path/$training_job_name/output/model.tar.gz working/model/model-orig.tar.gz
### This command rolls back to the commit before they removed the deploy.py script. ###
!cd lib/incubator-mxnet && git checkout 26f44b71d8de84bbc88af496ae0aeb7ce535312d
### Unpack the model and move the files into a tmp directory ###
!cd working/model/tmp && tar xvfpz ../model.tar.gz.orig
!cd working/model/tmp && mv model_algo_1-0000.params model_resnet50_300-0100.params
!cd working/model/tmp && mv model_algo_1-symbol.json model_resnet50_300-symbol.json
### Extract the model artifacts and optimize them for DeepLens ###
!cd working/model/tmp && python3 ../../../lib/incubator-mxnet/example/ssd/deploy.py --network resnet50 --data-shape 300 --num-class 2 --epoch 100 --prefix model_
### Pack the model back up into the model directory ###
!cd working/model/tmp && mv model_resnet50_300-0100.params model_resnet50_300-0000.params
!cd working/model/tmp && tar cvfz ../model.tar.gz model_resnet50_300-0000.params model_resnet50_300-symbol.json hyperparams.json
!cd working/model && aws s3 cp model.tar.gz $s3_output_path/$training_job_name/output/model.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment