Skip to content
Convert torch t7 model to pytorch model and source.
Python
Branch: master
Clone or download
clcarwin Merge pull request #20 from mschrimpf/master
copy_param, adjustment (output_padding), groups for ConvTranspose{2,3}d
Latest commit 58daa35 Nov 13, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Feb 16, 2017
LICENSE Initial commit Feb 16, 2017
README.md densenet Aug 24, 2017
convert_torch.py Merge pull request #20 from mschrimpf/master Nov 13, 2017

README.md

Convert torch to pytorch

Convert torch t7 model to pytorch model and source.

Convert

python convert_torch.py -m vgg16.t7

Two file will be created vgg16.py vgg16.pth

Example

import vgg16

model = 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
Inception-V1 cnn-benchmarks
VGG-16 cnn-benchmarks
VGG-19 cnn-benchmarks
ResNet-18 cnn-benchmarks
ResNet-200 cnn-benchmarks
ResNeXt-50 (32x4d) ResNeXt
ResNeXt-101 (32x4d) ResNeXt
ResNeXt-101 (64x4d) ResNeXt
DenseNet-264 (k=32) DenseNet
DenseNet-264 (k=48) DenseNet
You can’t perform that action at this time.