2

I have a caffe model with me which has crop layers in it so converting it to TensorFlow is posing a problem.
I have successfully loaded the model and dropped the crop layers and now I would like to save the corresponding model.prototxt and model.caffemodel
I found the following questions on StackOverflow but they are about replacing the layers and not permanently deleting them:
Layer drop and update caffe model
How to modify the Imagenet Caffe Model?

When I save the model using caffe.Net.save() only the model.caffemodel file gets saved and not the corresponding .prototxt. What to do ?
Model files : https://github.com/Charrin/RetinaFace-Cpp/tree/master/convert_models/mnet
Code used so far -

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')
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Tanmay Bhatnagar
  • 2,330
  • 4
  • 30
  • 50

0 Answers0