microsoft / MMdnn

MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
MIT License
5.8k stars 965 forks source link

Tensorflow has not supported operator [Less] with name [image_padding/pad_to_bounding_box/assert_positive/assert_less/Less]. #848

Open merria28 opened 4 years ago

merria28 commented 4 years ago

Platform (like ubuntu 16.04/win10): ubuntu

Python version: 3.6

Source framework with version (like Tensorflow 1.4.1 with GPU): Tensorflow 1.10 with GPU

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

Pre-trained model path (webpath or webdisk path): https://drive.google.com/drive/folders/1DYdxvMXm6n6BsOy4dOTbN9h43F0CoUoK

Running scripts: python -m mmdnn.conversion._script.convert -sf tensorflow -iw model.pb --inNodeName image_tensor --dstNodeName boxes scores num_boxes -df caffe -om tf_face_detection

Tensorflow has not supported operator [Less] with name [image_padding/pad_to_bounding_box/assert_positive/assert_less/Less]. Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/kangmeng/py3env/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 197, in _main() File "/home/kangmeng/py3env/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 192, in _main ret = _convert(args) File "/home/kangmeng/py3env/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 115, in _convert parser.run(args.dstPath) File "/home/kangmeng/py3env/lib/python3.6/site-packages/mmdnn/conversion/common/DataStructure/parser.py", line 22, in run self.gen_IR() File "/home/kangmeng/py3env/lib/python3.6/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 398, in gen_IR self.rename_UNKNOWN(current_node) File "/home/kangmeng/py3env/lib/python3.6/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 460, in rename_UNKNOWN assert False AssertionError

How can I convert the pb model to caffe? Any suggests? I will appreciate it .

linmajia commented 4 years ago

@merria28 , thank you very much for the feedback. MMdnn does not support the TensorFlow "Less" operator currently. It seems that Caffe does not support any control-flow operators like "Less", so I guess that you may not convert the model to Caffe.