我想将 Resnet50 预训练文件“ResNet-50-model.caffemodel”导入到chainer。这是链接器代码:
class chexnet(L.ResNet50Layers):
def __init__(self, pretrained_model="auto", out_features=2):
super(chexnet, self).__init__(pretrained_model)
with self.init_scope():
self.classifier = L.Linear(2048, out_features)
但我收到如下错误消息:
File "/home/tamnt27/.local/lib/python3.5/site-packages/chainer/links/model/vision/resnet.py", line 148, in convert_caffemodel_to_npz
caffemodel = CaffeFunction(path_caffemodel)
File "/home/tamnt27/.local/lib/python3.5/site-packages/chainer/links/caffe/caffe_function.py", line 151, in __init__
net.MergeFromString(model_file.read())
google.protobuf.message.DecodeError: Error parsing message
我不知道为什么会发生这个错误,它应该可以工作,请帮助我。谢谢你们。