Open caesar84 opened 5 years ago
hi there, I am trying to convert a Caffe model to IR or ONNX but I am hitting the wall. the Caffe model files are from . i followed the steps in the installation and when i run this :
mmtoir -f Caffe -n TrailNet_SResNet-18.prototxt -w TrailNet_SResNet-18.caffemodel -o caffe_resnet_IR
i get this : WARNING: PyCaffe not found! Falling back to a pure protocol buffer implementation.
Data data -- (1, 3, 180, 320)
Scale sub_mean (1, 1, 1, 3) (1, 3, 180, 320)
Convolution conv1 (7, 7, 3, 64) (1, 64, 87, 157)
Scale conv1_srelu1_1 (1, 1, 1, 64) (1, 64, 87, 157)
ReLU conv1_srelu1_2 -- (1, 64, 87, 157)
Scale conv1_srelu1_3 (1, 1, 1, 64) (1, 64, 87, 157)
Pooling pool1 -- (1, 64, 43, 78)
Convolution res1_1_1 (3, 3, 64, 64) (1, 64, 43, 78)
Scale res1_1_1_srelu_1 (1, 1, 1, 64) (1, 64, 43, 78)
ReLU res1_1_1_srelu_2 -- (1, 64, 43, 78)
Scale res1_1_1_srelu_3 (1, 1, 1, 64) (1, 64, 43, 78)
Convolution res1_1_2 (3, 3, 64, 64) (1, 64, 43, 78)
Eltwise res1_1_sum -- (1, 64, 43, 78)
Scale res1_1_srelu_1 (1, 1, 1, 64) (1, 64, 43, 78)
ReLU res1_1_srelu_2 -- (1, 64, 43, 78)
Scale res1_1_srelu_3 (1, 1, 1, 64) (1, 64, 43, 78)
Convolution res1_2_1 (3, 3, 64, 64) (1, 64, 43, 78)
Scale res1_2_1_srelu_1 (1, 1, 1, 64) (1, 64, 43, 78)
ReLU res1_2_1_srelu_2 -- (1, 64, 43, 78)
Scale res1_2_1_srelu_3 (1, 1, 1, 64) (1, 64, 43, 78)
Convolution res1_2_2 (3, 3, 64, 64) (1, 64, 43, 78)
Eltwise res1_2_sum -- (1, 64, 43, 78)
Scale res1_2_srelu_1 (1, 1, 1, 64) (1, 64, 43, 78)
ReLU res1_2_srelu_2 -- (1, 64, 43, 78)
Scale res1_2_srelu_3 (1, 1, 1, 64) (1, 64, 43, 78)
Convolution res2_1_1 (3, 3, 64, 128) (1, 128, 43, 78)
Scale res2_1_1_srelu_1 (1, 1, 1, 128) (1, 128, 43, 78)
ReLU res2_1_1_srelu_2 -- (1, 128, 43, 78)
Scale res2_1_1_srelu_3 (1, 1, 1, 128) (1, 128, 43, 78)
Convolution res2_1_2 (3, 3, 128, 128) (1, 128, 22, 39)
Convolution res2_1_proj (1, 1, 64, 128) (1, 128, 22, 39)
Eltwise res2_1_sum -- (1, 128, 22, 39)
Scale res2_1_srelu_1 (1, 1, 1, 128) (1, 128, 22, 39)
ReLU res2_1_srelu_2 -- (1, 128, 22, 39)
Scale res2_1_srelu_3 (1, 1, 1, 128) (1, 128, 22, 39)
Convolution res2_2_1 (3, 3, 128, 128) (1, 128, 22, 39)
Scale res2_2_1_srelu_1 (1, 1, 1, 128) (1, 128, 22, 39)
ReLU res2_2_1_srelu_2 -- (1, 128, 22, 39)
Scale res2_2_1_srelu_3 (1, 1, 1, 128) (1, 128, 22, 39)
Convolution res2_2_2 (3, 3, 128, 128) (1, 128, 22, 39)
Eltwise res2_2_sum -- (1, 128, 22, 39)
Scale res2_2_srelu_1 (1, 1, 1, 128) (1, 128, 22, 39)
ReLU res2_2_srelu_2 -- (1, 128, 22, 39)
Scale res2_2_srelu_3 (1, 1, 1, 128) (1, 128, 22, 39)
Convolution res3_1_1 (3, 3, 128, 256) (1, 256, 22, 39)
Scale res3_1_1_srelu_1 (1, 1, 1, 256) (1, 256, 22, 39)
ReLU res3_1_1_srelu_2 -- (1, 256, 22, 39)
Scale res3_1_1_srelu_3 (1, 1, 1, 256) (1, 256, 22, 39)
Convolution res3_1_2 (3, 3, 256, 256) (1, 256, 11, 20)
Convolution res3_1_proj (1, 1, 128, 256) (1, 256, 11, 20)
Eltwise res3_1_sum -- (1, 256, 11, 20)
Scale res3_1_srelu_1 (1, 1, 1, 256) (1, 256, 11, 20)
ReLU res3_1_srelu_2 -- (1, 256, 11, 20)
Scale res3_1_srelu_3 (1, 1, 1, 256) (1, 256, 11, 20)
Convolution res3_2_1 (3, 3, 256, 256) (1, 256, 11, 20)
Scale res3_2_1_srelu_1 (1, 1, 1, 256) (1, 256, 11, 20)
ReLU res3_2_1_srelu_2 -- (1, 256, 11, 20)
Scale res3_2_1_srelu_3 (1, 1, 1, 256) (1, 256, 11, 20)
Convolution res3_2_2 (3, 3, 256, 256) (1, 256, 11, 20)
Eltwise res3_2_sum -- (1, 256, 11, 20)
Scale res3_2_srelu_1 (1, 1, 1, 256) (1, 256, 11, 20)
ReLU res3_2_srelu_2 -- (1, 256, 11, 20)
Scale res3_2_srelu_3 (1, 1, 1, 256) (1, 256, 11, 20)
Convolution res4_1_1 (3, 3, 256, 512) (1, 512, 11, 20)
Scale res4_1_1_srelu_1 (1, 1, 1, 512) (1, 512, 11, 20)
ReLU res4_1_1_srelu_2 -- (1, 512, 11, 20)
Scale res4_1_1_srelu_3 (1, 1, 1, 512) (1, 512, 11, 20)
Convolution res4_1_2 (3, 3, 512, 512) (1, 512, 6, 10)
Convolution res4_1_proj (1, 1, 256, 512) (1, 512, 6, 10)
Eltwise res4_1_sum -- (1, 512, 6, 10)
Scale res4_1_srelu_1 (1, 1, 1, 512) (1, 512, 6, 10)
ReLU res4_1_srelu_2 -- (1, 512, 6, 10)
Scale res4_1_srelu_3 (1, 1, 1, 512) (1, 512, 6, 10)
Convolution res4_2_1 (3, 3, 512, 512) (1, 512, 6, 10)
Scale res4_2_1_srelu_1 (1, 1, 1, 512) (1, 512, 6, 10)
ReLU res4_2_1_srelu_2 -- (1, 512, 6, 10)
Scale res4_2_1_srelu_3 (1, 1, 1, 512) (1, 512, 6, 10)
Convolution res4_2_2 (3, 3, 512, 512) (1, 512, 6, 10)
Eltwise res4_2_sum -- (1, 512, 6, 10)
Scale res4_2_srelu_1 (1, 1, 1, 512) (1, 512, 6, 10)
ReLU res4_2_srelu_2 -- (1, 512, 6, 10)
Scale res4_2_srelu_3 (1, 1, 1, 512) (1, 512, 6, 10)
Pooling pool_avg -- (1, 512, 4, 8)
InnerProduct fc3 (16384, 3) (1, 3, 1, 1)
Softmax softmax -- (1, 3, 1, 1)
InnerProduct fc3_t (16384, 3) (1, 3, 1, 1)
Softmax softmax_t -- (1, 3, 1, 1)
Concat concat -- (1, 6, 1, 1)
Traceback (most recent call last):
File "/usr/local/bin/mmtoir", line 11, in
does anyone have any idea what's wrong? I have tried to reinstall python and MMdn couple of times and still doesn't work.
Update: i have tried to use Docker installation and tried the example of resnet 152 and it went through as i converted it from caffe to IR then from IR to keras . However, when i try to convert Treilnet_SResnet_18 ( the one in the post above) here is the output with the error:
Data data -- (1, 3, 180, 320)
Scale sub_mean (3,) (1, 3, 180, 320)
Convolution conv1 (7, 7, 3, 64) (1, 64, 87, 157)
Scale conv1_srelu1_1 (64,) (1, 64, 87, 157)
ReLU conv1_srelu1_2 -- (1, 64, 87, 157)
Scale conv1_srelu1_3 (64,) (1, 64, 87, 157)
Pooling pool1 -- (1, 64, 43, 78)
Convolution res1_1_1 (3, 3, 64, 64) (1, 64, 43, 78)
Scale res1_1_1_srelu_1 (64,) (1, 64, 43, 78)
ReLU res1_1_1_srelu_2 -- (1, 64, 43, 78)
Scale res1_1_1_srelu_3 (64,) (1, 64, 43, 78)
Convolution res1_1_2 (3, 3, 64, 64) (1, 64, 43, 78)
Eltwise res1_1_sum -- (1, 64, 43, 78)
Scale res1_1_srelu_1 (64,) (1, 64, 43, 78)
ReLU res1_1_srelu_2 -- (1, 64, 43, 78)
Scale res1_1_srelu_3 (64,) (1, 64, 43, 78)
Convolution res1_2_1 (3, 3, 64, 64) (1, 64, 43, 78)
Scale res1_2_1_srelu_1 (64,) (1, 64, 43, 78)
ReLU res1_2_1_srelu_2 -- (1, 64, 43, 78)
Scale res1_2_1_srelu_3 (64,) (1, 64, 43, 78)
Convolution res1_2_2 (3, 3, 64, 64) (1, 64, 43, 78)
Eltwise res1_2_sum -- (1, 64, 43, 78)
Scale res1_2_srelu_1 (64,) (1, 64, 43, 78)
ReLU res1_2_srelu_2 -- (1, 64, 43, 78)
Scale res1_2_srelu_3 (64,) (1, 64, 43, 78)
Convolution res2_1_1 (3, 3, 64, 128) (1, 128, 43, 78)
Scale res2_1_1_srelu_1 (128,) (1, 128, 43, 78)
ReLU res2_1_1_srelu_2 -- (1, 128, 43, 78)
Scale res2_1_1_srelu_3 (128,) (1, 128, 43, 78)
Convolution res2_1_2 (3, 3, 128, 128) (1, 128, 22, 39)
Convolution res2_1_proj (1, 1, 64, 128) (1, 128, 22, 39)
Eltwise res2_1_sum -- (1, 128, 22, 39)
Scale res2_1_srelu_1 (128,) (1, 128, 22, 39)
ReLU res2_1_srelu_2 -- (1, 128, 22, 39)
Scale res2_1_srelu_3 (128,) (1, 128, 22, 39)
Convolution res2_2_1 (3, 3, 128, 128) (1, 128, 22, 39)
Scale res2_2_1_srelu_1 (128,) (1, 128, 22, 39)
ReLU res2_2_1_srelu_2 -- (1, 128, 22, 39)
Scale res2_2_1_srelu_3 (128,) (1, 128, 22, 39)
Convolution res2_2_2 (3, 3, 128, 128) (1, 128, 22, 39)
Eltwise res2_2_sum -- (1, 128, 22, 39)
Scale res2_2_srelu_1 (128,) (1, 128, 22, 39)
ReLU res2_2_srelu_2 -- (1, 128, 22, 39)
Scale res2_2_srelu_3 (128,) (1, 128, 22, 39)
Convolution res3_1_1 (3, 3, 128, 256) (1, 256, 22, 39)
Scale res3_1_1_srelu_1 (256,) (1, 256, 22, 39)
ReLU res3_1_1_srelu_2 -- (1, 256, 22, 39)
Scale res3_1_1_srelu_3 (256,) (1, 256, 22, 39)
Convolution res3_1_2 (3, 3, 256, 256) (1, 256, 11, 20)
Convolution res3_1_proj (1, 1, 128, 256) (1, 256, 11, 20)
Eltwise res3_1_sum -- (1, 256, 11, 20)
Scale res3_1_srelu_1 (256,) (1, 256, 11, 20)
ReLU res3_1_srelu_2 -- (1, 256, 11, 20)
Scale res3_1_srelu_3 (256,) (1, 256, 11, 20)
Convolution res3_2_1 (3, 3, 256, 256) (1, 256, 11, 20)
Scale res3_2_1_srelu_1 (256,) (1, 256, 11, 20)
ReLU res3_2_1_srelu_2 -- (1, 256, 11, 20)
Scale res3_2_1_srelu_3 (256,) (1, 256, 11, 20)
Convolution res3_2_2 (3, 3, 256, 256) (1, 256, 11, 20)
Eltwise res3_2_sum -- (1, 256, 11, 20)
Scale res3_2_srelu_1 (256,) (1, 256, 11, 20)
ReLU res3_2_srelu_2 -- (1, 256, 11, 20)
Scale res3_2_srelu_3 (256,) (1, 256, 11, 20)
Convolution res4_1_1 (3, 3, 256, 512) (1, 512, 11, 20)
Scale res4_1_1_srelu_1 (512,) (1, 512, 11, 20)
ReLU res4_1_1_srelu_2 -- (1, 512, 11, 20)
Scale res4_1_1_srelu_3 (512,) (1, 512, 11, 20)
Convolution res4_1_2 (3, 3, 512, 512) (1, 512, 6, 10)
Convolution res4_1_proj (1, 1, 256, 512) (1, 512, 6, 10)
Eltwise res4_1_sum -- (1, 512, 6, 10)
Scale res4_1_srelu_1 (512,) (1, 512, 6, 10)
ReLU res4_1_srelu_2 -- (1, 512, 6, 10)
Scale res4_1_srelu_3 (512,) (1, 512, 6, 10)
Convolution res4_2_1 (3, 3, 512, 512) (1, 512, 6, 10)
Scale res4_2_1_srelu_1 (512,) (1, 512, 6, 10)
ReLU res4_2_1_srelu_2 -- (1, 512, 6, 10)
Scale res4_2_1_srelu_3 (512,) (1, 512, 6, 10)
Convolution res4_2_2 (3, 3, 512, 512) (1, 512, 6, 10)
Eltwise res4_2_sum -- (1, 512, 6, 10)
Scale res4_2_srelu_1 (512,) (1, 512, 6, 10)
ReLU res4_2_srelu_2 -- (1, 512, 6, 10)
Scale res4_2_srelu_3 (512,) (1, 512, 6, 10)
Pooling pool_avg -- (1, 512, 4, 8)
InnerProduct fc3 (16384, 3) (1, 3, 1, 1)
Softmax softmax -- (1, 3, 1, 1)
InnerProduct fc3_t (16384, 3) (1, 3, 1, 1)
Softmax softmax_t -- (1, 3, 1, 1)
Concat concat -- (1, 6, 1, 1)
Traceback (most recent call last):
File "/usr/local/bin/mmtoir", line 11, in
also when tried to convert directly to keras an had a problem in #720
@caesar84 Any update? I'm facing some problems trying the same thing. Could you convert the caffe models?
@lucasncabral No updates from here as you can see. However, I got my model converted by another guy who works in https://github.com/microsoft/MMdnn after Them way didn't work with my model as you can see from https://github.com/microsoft/MMdnn/issues/720. give it a go and see .
@caesar84 I also try convert my models with mmdnn, but i came to a problem: "too many values to unpack". Did you get a conversion with mmdnn?
your best bet is trying with them via an issue. If you check the above issue you can see that.
Platform (like ubuntu 16.04):
Python version:Python 3.6.3
Source framework with version (like Tensorflow 1.4.1 with GPU): caffe
Destination framework with version (like CNTK 2.3 with GPU): ONNX
Pre-trained model path (webpath or webdisk path):https://github.com/NVIDIA-AI-IOT/redtail/tree/master/models/pretrained
Running scripts: