Project-MONAI / Project-MONAI/MONAI

ValueError: Invalid input type <class 'NoneType'> encountered in the dynamo_compile input parsing

Open
#8,210 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description


[2024-11-14T19:28:21.224Z] ======================================================================

[2024-11-14T19:28:21.224Z] ERROR: test_handler (tests.test_trt_compile.TestTRTCompile)

[2024-11-14T19:28:21.224Z] ----------------------------------------------------------------------

[2024-11-14T19:28:21.224Z] Traceback (most recent call last):

[2024-11-14T19:28:21.224Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/tests/test_trt_compile.py", line 82, in test_handler

[2024-11-14T19:28:21.224Z]     net1.forward(torch.tensor([[0.0, 1.0], [1.0, 2.0]], device="cuda"))

[2024-11-14T19:28:21.224Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/networks/trt_compiler.py", line 598, in trt_forward

[2024-11-14T19:28:21.224Z]     return self._trt_compiler.forward(self, argv, kwargs)

[2024-11-14T19:28:21.224Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/networks/trt_compiler.py", line 451, in forward

[2024-11-14T19:28:21.224Z]     raise e

[2024-11-14T19:28:21.224Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/networks/trt_compiler.py", line 442, in forward

[2024-11-14T19:28:21.224Z]     self._build_and_save(model, build_args)

[2024-11-14T19:28:21.224Z]   File "/home/jenkins/agent/workspace/Monai-latest-image/monai/networks/trt_compiler.py", line 540, in _build_and_save

[2024-11-14T19:28:21.224Z]     engine_bytes = torch_tensorrt.convert_method_to_trt_engine(

[2024-11-14T19:28:21.224Z]   File "/usr/local/lib/python3.10/dist-packages/torch_tensorrt/_compile.py", line 351, in convert_method_to_trt_engine

[2024-11-14T19:28:21.224Z]     torchtrt_inputs = prepare_inputs(inputs)

[2024-11-14T19:28:21.224Z]   File "/usr/local/lib/python3.10/dist-packages/torch_tensorrt/dynamo/utils.py", line 176, in prepare_inputs

[2024-11-14T19:28:21.224Z]     torchtrt_input = prepare_inputs(

[2024-11-14T19:28:21.224Z]   File "/usr/local/lib/python3.10/dist-packages/torch_tensorrt/dynamo/utils.py", line 199, in prepare_inputs

[2024-11-14T19:28:21.224Z]     raise ValueError(

[2024-11-14T19:28:21.224Z] ValueError: Invalid input type <class 'NoneType'> encountered in the dynamo_compile input parsing. Allowed input types: {torch_tensorrt.Input, torch.Tensor, list, tuple, dict}

The error occurred on container 24.08

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/test_trt_compile.py at test_handler and follow the call into monai/networks/trt_compiler.py, especially the forward and _build_and_save paths named in the traceback. Reproduce the failure in container 24.08 and inspect how the dynamo_compile inputs are assembled. Done means the test no longer raises the reported NoneType ValueError and the TRT compile path remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.