vadimkantorov / caffemodel2pytorch

Convert Caffe models to PyTorch
389 stars 84 forks source link

Run Caffe models using PyTorch as backend #18

Open M-Hajakbari opened 4 years ago

M-Hajakbari commented 4 years ago

i tried do this : import torch import caffemodel2pytorch

model = caffemodel2pytorch.Net( prototxt = 'VGG_ILSVRC_16_layers_deploy.prototxt', weights = 'VGG_ILSVRC_16_layers.caffemodel', caffe_proto = 'https://github.com/intel/caffe/blob/master/src/caffe/proto/caffe.proto/') model.cuda() model.eval()

it just showed the error :

32         if caffe_pb2 is None:
 33                 local_caffe_proto = os.path.join(codegen_dir, os.path.basename(caffe_proto))

---> 34 with open(local_caffe_proto, 'w') as f: 35 mybytes = urlopen(caffe_proto).read() 36 mystr = mybytes.decode('ascii', 'ignore')

IsADirectoryError: [Errno 21] Is a directory: '/tmp/tmpdrkuoyvy/'

can you help me? thanks

vadimkantorov commented 4 years ago
  1. You should pass a direct http url, like in the README: caffe_proto = 'https://raw.githubusercontent.com/BVLC/caffe/master/src/caffe/proto/caffe.proto'
  2. Please do some debugging. I'm not actively working on this project, so you should try to do some debugging yourself: check what is local_caffe_proto variable value and such. Sorry :(