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 965 forks source link

IndexError: list index out of range when converting TF Inception3 to IR #107

Open felix-tracxpoint opened 6 years ago

felix-tracxpoint commented 6 years ago

Platform (like ubuntu 16.04/win10): Win10

Python version: 3.5

Source framework with version (like Tensorflow 1.4.1 with GPU): TF 1.5

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

(tracx) C:\Users\USER>python -m mmdnn.conversion._script.convertToIR -f tensorflow -n c:\Users\USER\alon\c1\_retrain_checkpoint.meta -d c:\temp -node final_result

C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Parse file [c:\Users\USER\alon\c1\_retrain_checkpoint.meta] with binary format successfully.
Tensorflow model file [c:\Users\USER\alon\c1\_retrain_checkpoint.meta] loaded successfully.
Tensorflow has not supported operator [DecodeJpeg] with name [DecodeJpeg].
Tensorflow has not supported operator [Cast] with name [Cast].
Tensorflow has not supported operator [ExpandDims] with name [ExpandDims].
Tensorflow has not supported operator [ResizeBilinear] with name [ResizeBilinear].
Tensorflow has not supported operator [Mul] with name [Mul].
Traceback (most recent call last):
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 159, in <module>
    _main()
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 154, in _main
    ret = _convert(args)
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 95, in _convert
    parser.gen_IR()
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\mmdnn\conversion\tensorflow\tensorflow_parser.py", line 281, in gen_IR
    func(current_node)
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\mmdnn\conversion\tensorflow\tensorflow_parser.py", line 370, in rename_Conv2D
    W = self.tf_graph.get_node(W.layer.input[0]).layer
  File "C:\Users\USER\Anaconda3\envs\tracx\lib\site-packages\google\protobuf\internal\containers.py", line 204, in __getitem__
    return self._values[key]
IndexError: list index out of range

What am I doing wrong?

Thanks!!

kitstar commented 6 years ago

Hi @felix-tracxpoint , the problem is, image preprocessing is a part of your model, whose operators are not implemented in our TensorFlow parser. I can try to ignore these layer to see if it still works. Could you provide the meta file for us to test?

Thanks.

felix-tracxpoint commented 6 years ago

Hi, thanks for getting back to me!

I put the files in the following directory: http://www.mediafire.com/?t5a2vabg7pk4x

kitstar commented 6 years ago

@namizzz We could skip these layers (with .real_name) or reset the input node to convert this model.

LeeRel1991 commented 6 years ago

Hi @kitstar , would you like to implemet the Pack, Shape,Conv2DBackpropInput operators in your tensorflow parser? cause it is necessary for transpose convolution. the exact net I'm doing is resfcn256 in paper,
Thanks.

namizzz commented 6 years ago

Hi @LeeRel1991, MMdnn can only convert the architecture of a network. Can you remove backward part and upload the model file ? Or you can follow the guide to implement it in parser.

luisarbezerra commented 6 years ago

Hi,

I'm still getting this error too. Tensorflow has not supported operator [NoOp] any ideas?

namizzz commented 6 years ago

Hi @luisarbezerra , could you provide the model file(.ckpt or .pb)?

luisarbezerra commented 6 years ago

Hi! I'm facing this problem below and I have no idea about it. Do you have any idea about it? Thanks since now

mmtoir -f tensorflow -d alexnet -n model.meta --dstNodeName fc8/fc8

Info: Trying to parse file [model.meta] with binary format but failed with error [Error parsing message]. Parse file [model.meta] with text format successfully. Tensorflow model file [model.meta] loaded successfully. Tensorflow has not supported operator [NoOp] with name [split_3:1]. Tensorflow has not supported operator [NoOp] with name [split_5:1]. Tensorflow has not supported operator [NoOp] with name [split_1:1]. Tensorflow has not supported operator [NoOp] with name [split_2:1]. Tensorflow has not supported operator [NoOp] with name [split:1]. Tensorflow has not supported operator [NoOp] with name [split_4:1]. Traceback (most recent call last): File "/home/lbezerra/.local/bin/mmtoir", line 11, in sys.exit(_main()) File "/home/lbezerra/.local/lib/python2.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 184, in _main ret = _convert(args) File "/home/lbezerra/.local/lib/python2.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 102, in _convert parser.run(args.dstPath) File "/home/lbezerra/.local/lib/python2.7/site-packages/mmdnn/conversion/common/DataStructure/parser.py", line 22, in run self.gen_IR() File "/home/lbezerra/.local/lib/python2.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 311, in gen_IR func(current_node) File "/home/lbezerra/.local/lib/python2.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 402, in rename_Conv2D W = self.tf_graph.get_node(W.layer.input[0]).layer IndexError: list index (0) out of range


De: namizzz notifications@github.com Enviado: quinta-feira, 5 de julho de 2018 02:10 Para: Microsoft/MMdnn Cc: Luísa Ribeiro Bezerra; Mention Assunto: Re: [Microsoft/MMdnn] IndexError: list index out of range when converting TF Inception3 to IR (#107)

Hi @luisarbezerrahttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fluisarbezerra&data=02%7C01%7C%7C8f032e9c8b1f449ee92a08d5e23592f7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636663642080635494&sdata=2mlo83Ts9AwSS%2FjSmhf09sXdK5ZhkxlNgnKsguUDAmo%3D&reserved=0 , could you provide the model file(.ckpt or .pb)?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FMMdnn%2Fissues%2F107%23issuecomment-402607840&data=02%7C01%7C%7C8f032e9c8b1f449ee92a08d5e23592f7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636663642080635494&sdata=iK53265ShaEUEotdahB7ZHnantIggBsjq7p3nVAdRYI%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPzJOIt91MRZU9n_5y2fqa42pGA-Hzfkks5uDZ-ugaJpZM4SqOoS&data=02%7C01%7C%7C8f032e9c8b1f449ee92a08d5e23592f7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636663642080635494&sdata=ZwgnbeuwvBPQY9JoMM1hiZp6hKhkO%2BPh3PE8DcJGm5Y%3D&reserved=0.

bayonettablack commented 5 years ago

@kitstar how to solve this problem?

MasterGG commented 5 years ago

Hi, @kitstar i got this problem, how can i fix it ? appreciate for your idea.

$ sudo mmconvert -sf tensorflow -iw segment_fixed_freeze_1119.pb --inNodeName image --inputShape 512,512,3 --dstNodeName logits/semantic/BiasAdd -df caffe -om tf_sgementnet 2018-12-25 23:42:48.927970: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA Traceback (most recent call last): File "/usr/local/bin/mmconvert", line 11, in sys.exit(_main()) File "/usr/local/lib/python3.6/dist-packages/mmdnn/conversion/_script/convert.py", line 102, in _main ret = convertToIR._convert(ir_args) File "/usr/local/lib/python3.6/dist-packages/mmdnn/conversion/_script/convertToIR.py", line 115, in _convert parser.run(args.dstPath) File "/usr/local/lib/python3.6/dist-packages/mmdnn/conversion/common/DataStructure/parser.py", line 22, in run self.gen_IR() File "/usr/local/lib/python3.6/dist-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 346, in gen_IR func(current_node) File "/usr/local/lib/python3.6/dist-packages/mmdnn/conversion/tensorflow/tensorflow_frozenparser.py", line 607, in rename_Mul if scopes[-2] == "batchnorm": IndexError: list index out of range

chen-9824 commented 3 years ago

Hi @kitstar , would you like to implemet the Pack, Shape,Conv2DBackpropInput operators in your tensorflow parser? cause it is necessary for transpose convolution. the exact net I'm doing is resfcn256 in paper, Thanks.

Have you found a solution? Can I ask you something?