microsoft / MMdnn

MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
MIT License
5.79k stars 965 forks source link

could I convert self-made caffe models to pytorch models ? #498

Open CoinCheung opened 5 years ago

CoinCheung commented 5 years ago

Platform (like ubuntu 16.04/win10):

archlinux

Python version: python3.5

Source framework with version (like Tensorflow 1.4.1 with GPU): caffe

Destination framework with version (like CNTK 2.3 with GPU): pytorch

Pre-trained model path (webpath or webdisk path): prototxt: http://www.cs.jhu.edu/~alanlab/ccvl/DeepLab-COCO-LargeFOV/train.prototxt model: http://www.cs.jhu.edu/~alanlab/ccvl/init_models/vgg16_20M.caffemodel

Running scripts: mmconvert -sf caffe -in train.prototxt -iw vgg16_20M.caffemodel -df pytorch -om vgg16.dnn

CoinCheung commented 5 years ago

This command does not work for me, so what is the correct way to convert this caffe model for use of pytorch to implement fine tune ?

leesky1c commented 5 years ago

same issue

rainLiuplus commented 5 years ago

Maybe you can try step-by-step conversion, https://github.com/Microsoft/MMdnn/blob/master/mmdnn/conversion/tensorflow/README.md#step-by-step-conversion-for-debugging