我有一个caffe模型,其中有crop
层,因此将其转换为TensorFlow会带来问题。
我已成功加载模型并删除了crop
层,现在我想保存相应的model.prototxt
和model.caffemodel
我在StackOverflow上发现了以下问题,但它们是关于替换层而不是永久删除层的:
Layer drop and update caffe model
How to modify the Imagenet Caffe Model?
当我使用caffe.Net.save()
保存模型时,只保存model.caffemodel
文件,而不保存相应的.prototxt
。怎么办?
模型文件:https://github.com/Charrin/RetinaFace-Cpp/tree/master/convert_models/mnet
迄今为止使用的代码-
import caffe
net = caffe.Net('mnet.prototxt', 'mnet.caffemodel' , caffe.TEST)
del net.layer_dict['crop1']
del net.layer_dict['crop0']
net.save('new_model.caffemodel')
目前没有回答
相关问题 更多 >
编程相关推荐