https://github.com/vfdev-5/pytorch_scripting_tests
Scripting basic example
https://github.com/vfdev-5/pytorch_scripting_tests
Last synced: 10 months ago
JSON representation
Scripting basic example
- Host: GitHub
- URL: https://github.com/vfdev-5/pytorch_scripting_tests
- Owner: vfdev-5
- Created: 2018-12-24T09:06:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-24T09:06:39.000Z (over 7 years ago)
- Last Synced: 2025-06-01T00:02:49.709Z (about 1 year ago)
- Language: Python
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Check pytorch scripting
- Script pretrained resnet18 model
- Save on disk
- Create a docker image
- Execute docker container with scripted model and predict on a test image
## Create docker image
Using dev environment with pytorch 1.0, latest nighlty, run the following
```
python export_model.py
```
and then create docker image
```
docker build -t pytorch_resnet18:latest .
```
Note: it is important to have same pytorch 1.0 nightly builds to avoid libraries incompatibility.
## Execute docker image
```
docker run --rm pytorch_resnet18:latest
```
the output should be `162` which corresponds to `Beagle` (dog's breed on the image `dog-12.jpg`)