赞
踩
推理实现过程参考的tensorRT github项目的example中的yolov3-https://github.com/NVIDIA/TensorRT/tree/release/8.6/samples/python/yolov3_onnx
报错是出现在common文件的HostDeviceMem函数中,意思是float16类型在ctype中没有定义,解决方式见TensorRT issue #3222:
I made a workaround :
1. Initialize np.ndarray from int16 ctypes point
2. use arr.dtype = np.float16 to change dtype inplace.
其意思就是既然ctype没有该类型,就在开辟内存时用int16类型来代替float16,因为他们占用的内存大小是一样的。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。