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.79k stars 964 forks source link

tensorflow_frozenparser.py:441 assert False in rename_UNKNOWN #637

Open thefiddler opened 5 years ago

thefiddler commented 5 years ago

Platform: archlinux

Python version: 3.7.2

Source framework with version: Tensorflow 1.13 with GPU

Destination framework with version: onnx

Pre-trained model path (webpath or webdisk path): test.pb.zip

Running scripts: mmconvert -sf tensorflow -iw test.pb --inNodeName "in" --inputShape "512,512,1" --dstNodeName "out" -df onnx -om test.onnx 2>1 error.txt

WARNING:tensorflow:From /usr/lib/python3.7/site-packages/tensorflow/python/tools/strip_unused_lib.py:86: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.compat.v1.graph_util.extract_sub_graph
Traceback (most recent call last):
  File "/home/ursula/.local/bin/mmconvert", line 10, in <module>
    sys.exit(_main())
  File "/home/ursula/.local/lib/python3.7/site-packages/mmdnn/conversion/_script/convert.py", line 102, in _main
    ret = convertToIR._convert(ir_args)
  File "/home/ursula/.local/lib/python3.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 115, in _convert
    parser.run(args.dstPath)
  File "/home/ursula/.local/lib/python3.7/site-packages/mmdnn/conversion/common/DataStructure/parser.py", line 22, in run
    self.gen_IR()
  File "/home/ursula/.local/lib/python3.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 379, in gen_IR
    self.rename_UNKNOWN(current_node)
  File "/home/ursula/.local/lib/python3.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 441, in rename_UNKNOWN
    assert False
AssertionError
rainLiuplus commented 5 years ago

Hi @thefiddler, there are a few unimplemented ops, including [Ceil], [Round] and [ResizeBicubic], which caused this error. But it seems that the model you provided is more like a preprocessing part of a complete model. If so, I need to explain that MMdnn does not support preprocessing of the conversion model. Thanks.

thefiddler commented 5 years ago

@rainLiuplus thank you for your reply. This is indeed part of a complete model that was failing to be converted.

I simply isolated the failing part so that the issue can be reproduced more easily.

rainLiuplus commented 5 years ago

Emm, so MMdnn does not support it. Maybe you can write code manually to implement preprocessing.

arya-none commented 4 years ago

Dear @rainLiuplus would you help to figure out,whats the problem? since i found "MaxPoolWithArgmax" exist in tensorflow documentation. when use mmdnn convert, it shew me "Tensorflow has not supported operator [MaxPoolWithArgmax] with name [resnet_model/MaxPoolWithArgmax]."

WARNING:tensorflow:From /usr/local/python3.7.5/lib/python3.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py:175: The name tf.train.export_meta_graph is deprecated. Please use tf.compat.v1.train.export_meta_graph instead.

Tensorflow has not supported operator [MaxPoolWithArgmax] with name [resnet_model/MaxPoolWithArgmax]. Traceback (most recent call last): File "/usr/local/python3.7.5/bin/mmconvert", line 8, in sys.exit(_main()) File "/usr/local/python3.7.5/lib/python3.7/site-packages/mmdnn/conversion/_script/convert.py", line 102, in _main ret = convertToIR._convert(ir_args) File "/usr/local/python3.7.5/lib/python3.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 120, in _convert parser.run(args.dstPath) File "/usr/local/python3.7.5/lib/python3.7/site-packages/mmdnn/conversion/common/DataStructure/parser.py", line 22, in run self.gen_IR() File "/usr/local/python3.7.5/lib/python3.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 397, in gen_IR self.rename_UNKNOWN(current_node) File "/usr/local/python3.7.5/lib/python3.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 459, in rename_UNKNOWN assert False AssertionError