Python 删除图层后保存caffe模型

Python 删除图层后保存caffe模型,python,python-3.x,deep-learning,caffe,Python,Python 3.x,Deep Learning,Caffe,我有一个caffe模型,其中包含裁剪层,因此将其转换为TensorFlow会带来问题。 我已成功加载模型并删除裁剪层,现在我想保存相应的model.prototxt和model.caffemodel 我在StackOverflow上发现了以下问题,但它们是关于替换层而不是永久删除层的: 使用caffe.Net.save()保存模型时,仅保存model.caffemodel文件,而不保存相应的.prototxt。怎么办? 模型文件: 迄今为止使用的代码- import caffe net =

我有一个caffe模型,其中包含
裁剪
层,因此将其转换为TensorFlow会带来问题。
我已成功加载模型并删除
裁剪
层,现在我想保存相应的
model.prototxt
model.caffemodel

我在StackOverflow上发现了以下问题,但它们是关于替换层而不是永久删除层的:

使用
caffe.Net.save()
保存模型时,仅保存
model.caffemodel
文件,而不保存相应的
.prototxt
。怎么办?
模型文件:
迄今为止使用的代码-

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')