我想用tensorRT来部署我的pytorch模型,但我在导入tensorRT时遇到了一个问题
Traceback (most recent call last):
File "/home/fffan/fffan_files/Experiment/pytorch-tensorrt-master/model2trt.py", line 10, in <module>
import calib as calibrator
File "/home/fffan/fffan_files/Experiment/pytorch-tensorrt-master/calib.py", line 13, in <module>
class PythonEntropyCalibrator(trt.infer.EntropyCalibrator):
AttributeError: module 'tensorrt' has no attribute 'infer'
代码如下所示:
class PythonEntropyCalibrator(trt.infer.EntropyCalibrator):
def __init__(self, input_layers, stream):
trt.infer.EntropyCalibrator.__init__(self)
self.input_layers = input_layers
self.stream = stream
self.d_input = cuda.mem_alloc(self.stream.calibration_data.nbytes)
stream.reset()
我的张力是5.1.5。 知道的人请告诉我。非常感谢
目前没有回答
相关问题 更多 >
编程相关推荐