MMdnn icon indicating copy to clipboard operation
MMdnn copied to clipboard

tf2caffe problem "tensorflow.MetaGraphDef" has no field named "Placeholder"..

Open Simplesss opened this issue 6 years ago • 4 comments

Platform (like ubuntu 16.04/win10): ubuntu 16.04

Python version: 2.7

Source framework with version (like Tensorflow 1.4.1 with GPU): tensorflow1.12.0

Destination framework with version (like CNTK 2.3 with GPU):caffe

Pre-trained model path (webpath or webdisk path):https://github.com/Simplesss/Face-attribue

Running scripts:mmconvert -sf tensorflow -in ~/PycharmProjects/Tensorflow-TCDCN/pretrained/frozen_model.pb --inNodeName Placeholder Placeholder_6 --inputShape 1,40,40,3 1 --dstNodeName add_5 add_6 add_7 add_8 add_9 -df caffe -om tf_tensorflow Info: Trying to parse file [/home/cui/PycharmProjects/Tensorflow-TCDCN/pretrained/utf8.pb] with binary format but failed with error [Error parsing message]. Traceback (most recent call last): File "/usr/local/bin/mmconvert", line 10, in sys.exit(_main()) File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/_script/convert.py", line 102, in _main ret = convertToIR._convert(ir_args) File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/_script/convertToIR.py", line 66, in _convert parser = TensorflowParser(args.network, args.weights, args.dstNodeName, inputshape[0], args.inNodeName) File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 189, in init model = TensorflowParser._load_meta(meta_file) File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 84, in _load_meta load_protobuf_from_file(meta_graph, model_network_path) File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/common/IR/IR_graph.py", line 31, in load_protobuf_from_file raise IOError("Cannot parse file %s: %s." % (filename, str(e))) IOError: Cannot parse file /home/cui/PycharmProjects/Tensorflow-TCDCN/pretrained/utf8.pb: 2:2 : Message type "tensorflow.MetaGraphDef" has no field named "Placeholder"..

I have two inputs:Placeholder and Placeholder_6, six outputs:add_5,add_6,add_7,add_8,add_9. There is something wrong with Placeholder,how can I fix it? thanks a lot for help.

Simplesss avatar Feb 21 '19 02:02 Simplesss

Hi @Simplesss , please change the running script to mmconvert -sf tensorflow -iw ~/PycharmProjects/Tensorflow-TCDCN/pretrained/frozen_model.pb --inNodeName Placeholder Placeholder_6 --inputShape 1,40,40,3 1 --dstNodeName add_5 add_6 add_7 add_8 add_9 -df caffe -om tf_tensorflow Thanks!

rainLiuplus avatar Feb 22 '19 02:02 rainLiuplus

Hi @Simplesss , please change the running script to mmconvert -sf tensorflow -iw ~/PycharmProjects/Tensorflow-TCDCN/pretrained/frozen_model.pb --inNodeName Placeholder Placeholder_6 --inputShape 1,40,40,3 1 --dstNodeName add_5 add_6 add_7 add_8 add_9 -df caffe -om tf_tensorflow Thanks!

I try it again!!! But it have the same error.

Simplesss avatar Feb 23 '19 11:02 Simplesss

Hi @Simplesss , I tried but it works ok except that it does not support [floor] op. Maybe you can downgrade your tensorflow to 1.10.0? For the [floor] op, you can manually add one in Caffe. Thanks!

rainLiuplus avatar Mar 04 '19 03:03 rainLiuplus

i have the same problem as you, have you solved it?

Jeremy8080 avatar Dec 29 '20 08:12 Jeremy8080