caffemodel2pytorch icon indicating copy to clipboard operation
caffemodel2pytorch copied to clipboard

Run Caffe models using PyTorch as backend

Open M-Hajakbari opened this issue 3 years ago • 1 comments

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

M-Hajakbari avatar Sep 22 '20 18:09 M-Hajakbari

  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 :(

vadimkantorov avatar Sep 22 '20 18:09 vadimkantorov