构建tensorrt engine报错
我按照教程https://huggingface.co/Tencent-Hunyuan/TensorRT-libs/blob/main/README.md自行构建tensorrt engine,安装按依赖后import tensorrt可以成功导入,在进行sh trt/build_engine.sh构建engine时报错,无法导出成功:
[07/18/2024-07:49:33] [E] Cannot find input tensor with name "encoder_hidden_states" in the network inputs! Please make sure the input tensor names are correct.
[07/18/2024-07:49:33] [E] Network And Config setup failed
[07/18/2024-07:49:33] [E] Building engine failed
[07/18/2024-07:49:33] [E] Failed to create engine from model or file.
[07/18/2024-07:49:33] [E] Engine set up failed
之后在进行推理时,报No module named 'cuda'错误:
有什么解决方案吗,谢谢~
I met the similar issue, and I check the onnx_file, I found that some input nodes are missing which is confusing!