STDC-Seg icon indicating copy to clipboard operation
STDC-Seg copied to clipboard

error in running run_latency_stages.py

Open fjremnav opened this issue 3 years ago • 5 comments

I got the following error when running python ./run_latency_stages.py:

[TensorRT] ERROR: Network must have at least one output [TensorRT] ERROR: Network validation failed. Traceback (most recent call last): File "./run_latency_stages.py", line 100, in main() File "./run_latency_stages.py", line 86, in main latency = compute_latency(model, inputDimension) File "/mnt/git/STDC-Seg/latentcy/utils/darts_utils.py", line 173, in compute_latency_ms_tensorrt with build_engine("model.onnx") as engine: AttributeError: enter

Any idea why this happens?

Thanks,

fjremnav avatar Jul 14 '21 15:07 fjremnav

@MichaelFan01

Can you help?

Thanks,

fjremnav avatar Jul 20 '21 18:07 fjremnav

@MichaelFan01

Can you help?

Thanks,

I can not help, cause TensorRT in Python language do not feedback the error reason. But If you want to debug your problem , I recommand you to use TensorRT in C++ langage, which feedback the error reason in detail.

MichaelFan01 avatar Jul 21 '21 07:07 MichaelFan01

@fjremnav Have you solved this? I come up with the same error

BeaverCC avatar Aug 11 '21 06:08 BeaverCC

@fjremnav Have you solved this? I come up with the same error

this helps me out

https://github.com/NVIDIA/TensorRT/issues/183#issuecomment-657673563

BeaverCC avatar Aug 11 '21 06:08 BeaverCC

this helps me out

NVIDIA/TensorRT#183 (comment)

I tried to change the build_engine in latency/utils/darts_utils.py as the following.

def build_engine(model_file):
    explicit_batch = 1 << (int)(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH)
    with trt.Builder(TRT_LOGGER) as builder, builder.create_network(explicit_batch) as network, trt.OnnxParser(network, TRT_LOGGER) as parser:

I am not sure if I'm doing it right. But it seems not working. Could you give me some suggestion? Thank you.

amokame avatar Jul 05 '22 08:07 amokame