longcw / pytorch2caffe

Convert PyTorch model to Caffemodel
541 stars 151 forks source link

which version of pytorch and torchvision should be used? advice needed #26

Closed dzyjjpy closed 5 years ago

dzyjjpy commented 5 years ago

which version of pytorch and torchvision should be used? advice needed. I tried torch 1.0.0 and 0.3.1 torchvision: 0.2.2, 0.2.0 errors occured: keyError: 'data' net.blobs['data'].data[...] = input_data

dose anyone have advice? And I have own model trained by torch 0.3.1, torchvision 0.2.0 want to convert to caffemodel for other engine to accelerate.

longcw commented 5 years ago

This should work with torch 0.3.1 or 0.2. Some layers may not well supported. Please check the demo first to see if it works.

dzyjjpy commented 5 years ago

when use torch 0.3.1, vision0.2.0, it can download the inceptionv3 model it shows network initialization done. but in File demo.py, line 49, in net.blobs['data'].data[...] = input_data keyError: 'data'

longcw commented 5 years ago

This line is to fill the data for caffe. So it's not the problem of pytorch.

dzyjjpy commented 5 years ago

@longcw I reinstall torch 0.3.1, solve the issue above. But another error occured when running demo.py line 165, in add_layer layer['type'] = layer_dict[parent_type] KeyErrors: 'ExpandBackward'

And it might be caused by layers not supported.I find same problem in issue. https://github.com/longcw/pytorch2caffe/issues/6 However , my CUDA is 9.2, I cannot install pytorch==0.2.0 Is there any other ways to solve this issue without reinllation for pytorch==0.2.0?

dzyjjpy commented 5 years ago

Finally solved by installing torch 0.2.0 and torchvision 0.1.8. will try my own model trained based torch 0.3.1