daquexian / onnx-simplifier

Simplify your onnx model
Apache License 2.0
3.79k stars 380 forks source link

tuple indices must be integers or slices, not NoneType #20

Open Enshall opened 5 years ago

Enshall commented 5 years ago

Hi @daquexian! I met this problem, "tuple indices must be integers or slices, not NoneType". Can you give me some advices ? Thank you so much !

D:\tools\pytorch2onnx>python -m onnxsim srnn.onnx srnn-sim.onnx D:\3rdparty\Anaconda3\envs\torch1.2\lib\site-packages\onnxruntime\capi\onnxruntime_validation.py:29: UserWarning: Unsupported Windows version (7). ONNX Runtime supports Windows 10 and above, only .warnings.warn('Unsupported Windows version (%s). ONNX Runtime supports Windows 10 and above, only.' % __my_distro_ver__) Simplifying... Traceback (most recent call last): File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\site-packages\onnxsim\__main__.py", line 24, in <module> main() File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\site-packages\onnxsim\__main__.py", line 17, in main model_opt = onnxsim.simplify(args.input_model, check_n=args.check_n, perform_optimization=not args.skip_optimization) File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\site-packages\onnxsim\onnx_simplifier.py", line 202, in simplify model_opt = eliminate_const_nodes(model_opt, const_nodes, res) File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\site-packages\onnxsim\onnx_simplifier.py", line 131, in eliminate_const_nodes vals=np.array(res[node.output[0]]).flatten().astype(get_np_type_from_elem_type(elem_type)) File "D:\3rdparty\Anaconda3\envs\torch1.2\lib\site-packages\onnxsim\onnx_simplifier.py", line 67, in get_np_type_from_elem_type size = sizes[elem_type] TypeError: tuple indices must be integers or slices, not NoneType

daquexian commented 5 years ago

Could you please send your model to daquexian566@gmail.com? Thanks!

Enshall commented 5 years ago

Hi @daquexian, I sended my model to your mail yesterday, thank you for your kindness !

daquexian commented 5 years ago

@Enshall I have received your model. I'll check it soon

daquexian commented 5 years ago

@Enshall 你好,请问你有 QQ/微信/telegram 吗,我们在上面说吧 > <

Enshall commented 5 years ago

嗯 我微信159 21153900qq 519713483------------------ Original ------------------From: daquexian notifications@github.comDate: Wed,Sep 25,2019 5:39 PMTo: daquexian/onnx-simplifier onnx-simplifier@noreply.github.comCc: Enshall muqing_1@163.com, Mention mention@noreply.github.comSubject: Re: [daquexian/onnx-simplifier] tuple indices must be integers orslices, not NoneType (#20)@Enshall 你好,请问你有 QQ/微信/telegram 吗,我们在上面说吧 > <

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/daquexian/onnx-simplifier/issues/20?email_source=notifications\u0026email_token=AHGLDLW3VQSD3UTJH37CU2LQLMWVVA5CNFSM4IW7GNP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RIXEY#issuecomment-534940563", "url": "https://github.com/daquexian/onnx-simplifier/issues/20?email_source=notifications\u0026email_token=AHGLDLW3VQSD3UTJH37CU2LQLMWVVA5CNFSM4IW7GNP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RIXEY#issuecomment-534940563", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]