Skip to content

执行可执行文件的时候报错了 #5

@xunxuntu

Description

@xunxuntu
root@rtx2060:/home/tuc/TensorRT_Inference_Demo-main/bin# ./object_detection yolov5 /home/tuc/yolov5-6.1/data/images/bus.jpg 
[08/16/2023-14:32:00] [I] [TRT] [MemUsageChange] Init CUDA: CPU +547, GPU +0, now: CPU 554, GPU 243 (MiB)
[08/16/2023-14:32:01] [I] [TRT] [MemUsageChange] Init builder kernel library: CPU +273, GPU +68, now: CPU 846, GPU 311 (MiB)
[08/16/2023-14:32:01] [I] [TRT] ----------------------------------------------------------------
[08/16/2023-14:32:01] [I] [TRT] Input filename:   ../weights/yolov5/yolov5s.onnx
[08/16/2023-14:32:01] [I] [TRT] ONNX IR version:  0.0.6
[08/16/2023-14:32:01] [I] [TRT] Opset version:    11
[08/16/2023-14:32:01] [I] [TRT] Producer name:    pytorch
[08/16/2023-14:32:01] [I] [TRT] Producer version: 1.11.0
[08/16/2023-14:32:01] [I] [TRT] Domain:           
[08/16/2023-14:32:01] [I] [TRT] Model version:    0
[08/16/2023-14:32:01] [I] [TRT] Doc string:       
[08/16/2023-14:32:01] [I] [TRT] ----------------------------------------------------------------
[08/16/2023-14:32:01] [W] [TRT] onnx2trt_utils.cpp:369: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[08/16/2023-14:32:01] [W] [TRT] onnx2trt_utils.cpp:395: One or more weights outside the range of INT32 was clamped
[08/16/2023-14:32:01] [E] [TRT] 4: [network.cpp::operator()::3020] Error Code 4: Internal Error (images: kOPT dimensions in profile 0 are [8,3,640,640] but input has static dimensions [1,3,640,640].)
[08/16/2023-14:32:01] [E] [TRT] 2: [builder.cpp::buildSerializedNetwork::636] Error Code 2: Internal Error (Assertion engine != nullptr failed. )
object_detection: /home/tuc/TensorRT_Inference_Demo-main/src/basemodel.cpp:57: void Model::OnnxToTRTModel(): Assertion `data' failed.
Aborted (core dumped)
按照您的教程readme文档的说明,使用yolov5-v6.1 仓库,执行完 
python export.py --weights=yolov5s.pt  --dynamic --simplify --include=onnx --opset 11
命令得到了onnx模型,并将onnx模型放入到 configs 文件夹的同级目录下的 weights 文件夹下的yolov5文件夹中。

接着进入 bin 文件夹,执行 
./object_detection yolov5 /home/tuc/yolov5-6.1/data/images/bus.jpg
命令,就出现了开头的core dump

请问 configs 下的 yolov5.yaml 文件中的 engine_file 字段的trt 文件是需要自己手动生成吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions