NVIDIA-developer-blog / code-samples

Source code examples from the Parallel Forall Blog
BSD 3-Clause "New" or "Revised" License
1.24k stars 633 forks source link

[TensorRT] ERROR: UFFParser: Parser error: input_2: Invalid number of Dimensions 0 #9

Open lucasjinreal opened 6 years ago

lucasjinreal commented 6 years ago

I run the code-samples/TensorRT3.1/convert.ipynb, but got this error:

[TensorRT] INFO: UFFParser: parsing input_2
[TensorRT] ERROR: UFFParser: Parser error: input_2: Invalid number of Dimensions 0
[TensorRT] ERROR: Failed to parse UFF model stream
  File "/usr/local/lib/python3.5/dist-packages/tensorrt/utils/_utils.py", line 186, in uff_to_trt_engine
    assert(parser_result)
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorrt/utils/_utils.py", line 186, in uff_to_trt_engine
    assert(parser_result)
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "convert.py", line 124, in <module>
    create_and_save_inference_engine()
  File "convert.py", line 99, in create_and_save_inference_engine
    trt.infer.DataType.FLOAT
  File "/usr/local/lib/python3.5/dist-packages/tensorrt/utils/_utils.py", line 194, in uff_to_trt_engine
    raise AssertionError('UFF parsing failed on line {} in statement {}'.format(line, text))
AssertionError: UFF parsing failed on line 186 in statement assert(parser_result)

We registered the input_1 as input why it still try to parse input_2? Many appreciate if got any reply!

faustomilletari commented 6 years ago

Could you please post here a snippet of your code in order to see where the problem is? This is only necessary if you are not running the example as we provide it in the repo.

lucasjinreal commented 6 years ago

I am using convert-tf-to-uff tool found that it is input_2 not input_1

gsandeep1231 commented 6 years ago

Inside this file there are 2 APIs /usr/local/lib/python3.5/dist-packages/tensorrt/utils/_utils.py I have always found issue with uff_to_trt_engine, however uff_file_to_trt_engine works just fine. The only different is in the later you pass the actual uff file and not the uff model.

Akhtar303nu commented 6 years ago

Hi @jinfagang have you solved this issue? if you solved ,please share the code Error File "/usr/local/lib/python3.5/dist-packages/tensorrt/utils/_utils.py", line 194, in uff_to_trt_engine raise AssertionError('UFF parsing failed on line {} in statement {}'.format(line, text)) AssertionError: UFF parsing failed on line 186 in statement assert(parser_result) Thanks