BUG:
Error Code 10: Internal Error (Could not find any implementation for node
[06/28/2022-09:03:12] [TRT] [W] TensorRT was linked against cuBLAS/cuBLAS LT 11.8.0 but loaded cuBLAS/cuBLAS LT 11.6.5
[06/28/2022-09:03:12] [TRT] [W] TensorRT was linked against cuDNN 8.3.2 but loaded cuDNN 8.2.4
[06/28/2022-09:03:28] [TRT] [W] Skipping tactic 0 due to insuficient memory on requested size of 99043584 detected for tactic 0.
[06/28/2022-09:03:28] [TRT] [E] 10: [optimizer.cpp::computeCosts::2033] Error Code 10: Internal Error (Could not find any implementation for node {ForeignNode[93...Add_4001]}.)
[06/28/2022-09:03:28] [TRT] [E] 2: [builder.cpp::buildSerializedNetwork::619] Error Code 2: Internal Error (Assertion engine != nullptr failed. )
[!] Invalid Engine. Please ensure the engine was built correctly
Traceback (most recent call last):
File "build_and_run.py", line 63, in <module>
main()
File "build_and_run.py", line 50, in main
with TrtRunner(build_engine) as runner:
解决方案:
通过增加workspace大小解决,代码如下:
build_engine = EngineFromNetwork(
NetworkFromOnnxPath(model_config["model_name"]+".onnx"), config=CreateConfig(max_workspace_size=1<<24, tf32=model_config['tf32'], fp16=model_config['fp16'])
)
# max_workspace_size=1<<24 -> max_workspace_size=10<<24