下面这个开源项目 caffe-tensorflow 提供了训练好的caffe模型转tensorflow模型的功能:
地址: https://github.com/ethereon/caffe-tensorflow
python2环境下
python2 ./convert.py ../open_nsfw/nsfw_model/deploy.prototxt --code-output-path=mynet.py
报错
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors should not be created directly, but only retrieved from their parent.
将kcaffe里的caffe_pb.py名字改为caffe_pb2.py,另外删掉caffe_pb.pyc 就可以了,,再修改resolver.py文件:
from . import caffe_pb2
self.caffepb = caffe_pb2
再次调用convert.py就可以了