Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clcarwin/convert_torch_to_pytorch
Convert torch t7 model to pytorch model and source.
https://github.com/clcarwin/convert_torch_to_pytorch
pytorch
Last synced: 3 months ago
JSON representation
Convert torch t7 model to pytorch model and source.
- Host: GitHub
- URL: https://github.com/clcarwin/convert_torch_to_pytorch
- Owner: clcarwin
- License: mit
- Created: 2017-02-16T06:23:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-10T23:21:03.000Z (over 1 year ago)
- Last Synced: 2024-08-04T00:12:49.350Z (6 months ago)
- Topics: pytorch
- Language: Python
- Size: 19.5 KB
- Stars: 539
- Watchers: 16
- Forks: 161
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-pytorch-list-CNVersion - convert_torch_to_pytorch
- Awesome-pytorch-list - convert_torch_to_pytorch
README
# Convert torch to pytorch
Convert torch t7 model to pytorch model and source.## Convert
```bash
python convert_torch.py -m vgg16.t7
```
Two file will be created ```vgg16.py``` ```vgg16.pth```## Example
```python
import vgg16model = vgg16.vgg16
model.load_state_dict(torch.load('vgg16.pth'))
model.eval()
...
```
## Validated
All the models in this table can be converted and the results have been validated.| Network | Download |
| ------------------- | -------- |
| AlexNet | [cnn-benchmarks](https://github.com/jcjohnson/cnn-benchmarks) |
| Inception-V1 | [cnn-benchmarks](https://github.com/jcjohnson/cnn-benchmarks) |
| VGG-16 | [cnn-benchmarks](https://github.com/jcjohnson/cnn-benchmarks) |
| VGG-19 | [cnn-benchmarks](https://github.com/jcjohnson/cnn-benchmarks) |
| ResNet-18 | [cnn-benchmarks](https://github.com/jcjohnson/cnn-benchmarks) |
| ResNet-200 | [cnn-benchmarks](https://github.com/jcjohnson/cnn-benchmarks) |
| ResNeXt-50 (32x4d) | [ResNeXt](https://github.com/facebookresearch/ResNeXt) |
| ResNeXt-101 (32x4d) | [ResNeXt](https://github.com/facebookresearch/ResNeXt) |
| ResNeXt-101 (64x4d) | [ResNeXt](https://github.com/facebookresearch/ResNeXt) |
| DenseNet-264 (k=32) | [DenseNet](https://github.com/liuzhuang13/DenseNet#results-on-imagenet-and-pretrained-models) |
| DenseNet-264 (k=48) | [DenseNet](https://github.com/liuzhuang13/DenseNet#results-on-imagenet-and-pretrained-models) |