https://github.com/vaaaaanquish/tch-rs-pretrain-example-docker
Docker for PyTorch rust bindings `tch`. Example of pretrain model.
https://github.com/vaaaaanquish/tch-rs-pretrain-example-docker
Last synced: about 1 year ago
JSON representation
Docker for PyTorch rust bindings `tch`. Example of pretrain model.
- Host: GitHub
- URL: https://github.com/vaaaaanquish/tch-rs-pretrain-example-docker
- Owner: vaaaaanquish
- License: mit
- Created: 2021-08-07T17:48:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-07T18:07:20.000Z (almost 5 years ago)
- Last Synced: 2025-03-30T09:41:28.589Z (over 1 year ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tch-rs-pretrain-example-docker
Docker for PyTorch rust bindings `tch-rs`. Example of pretrain model.
Docker files support the following
- install libtorch (1.9.0)
- download pretrain model weight file (resnet18)
- example script for model predict
# Usage
Please set `./img/example.jpeg`
```
docker build -t tch .
docker run -it tch
# cargo run
```
output example:
```
beagle 15.37%
golden retriever 11.95%
Labrador retriever 10.32%
Cardigan, Cardigan Welsh corgi 8.50%
Brittany spaniel 4.88%
```
# Background
I wanted to do Embedding. But it looks like we need to implement `register_forward_hook` in `tch`.
https://github.com/LaurentMazare/tch-rs/issues/218
So, I'm publishing it as an Example of pretrain model predict.