yolov7 icon indicating copy to clipboard operation
yolov7 copied to clipboard

'tensorrt.tensorrt.IBuilderConfig' object has no attribute 'set_memory_pool_limit'

Open beybars1 opened this issue 1 year ago • 5 comments

Hi,

I am having problem with model conversion from .onnx to .trt. I performed all steps mentioned in the repo:

wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-tiny.pt
python export.py --weights ./yolov7-tiny.pt --grid --end2end --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640
git clone https://github.com/Linaom1214/tensorrt-python.git
python ./tensorrt-python/export.py -o yolov7-tiny.onnx -e yolov7-tiny-nms.trt -p fp16

But I am getting log below after executing this:

root@b4afff2f378c:/workspace/yolov7/tensorrt-python# python ./export.py -o ../runs/train/yolov73/weights/best.onnx -e yolov7-foodai-nms.trt
Namespace(calib_batch_size=8, calib_cache='./calibration.cache', calib_input=None, calib_num_images=5000, conf_thres=0.4, end2end=False, engine='yolov7-foodai-nms.trt', iou_thres=0.5, max_det=100, onnx='../runs/train/yolov73/weights/best.onnx', precision='fp16', v8=False, verbose=False, workspace=1)
[TensorRT] INFO: [MemUsageChange] Init CUDA: CPU +820, GPU +0, now: CPU 845, GPU 3717 (MiB)
Traceback (most recent call last):
  File "./export.py", line 308, in <module>
    main(args)
  File "./export.py", line 266, in main
    builder = EngineBuilder(args.verbose, args.workspace)
  File "./export.py", line 109, in __init__
    self.config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace * (2 ** 30))
AttributeError: 'tensorrt.tensorrt.IBuilderConfig' object has no attribute 'set_memory_pool_limit'

Any help will be appreciated.

My system specs:

  • Ubuntu 22.04.2 LTS
  • Python 3.8.10
  • TensorRT 8.0.1.6
  • RTX 3090-Ti
  • CUDA 11.8

beybars1 avatar Jun 07 '23 18:06 beybars1

解决了吗?我也遇到一样的问题

windloveyou avatar Sep 26 '23 07:09 windloveyou

Hi @beybars1 @windloveyou did you solve the issue? I am also facing the same issue. Can you please help?

Seema1997 avatar Mar 11 '24 04:03 Seema1997

self.config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace * (2 ** 30))

Comment this may work.

tommyjiang avatar Apr 16 '24 07:04 tommyjiang

Hi @beybars1 @windloveyou did you solve the issue? I am also facing the same issue. Can you please help? Yes,you can do as this codes: self.config.max_workspace_size = workspace * (2 ** 30) If you success make it,please reply me~

windloveyou avatar Apr 16 '24 15:04 windloveyou

Hi @beybars1 @windloveyou did you solve the issue? I am also facing the same issue. Can you please help? Yes,you can do as this codes: self.config.max_workspace_size = workspace * (2 ** 30) If you success make it,please reply me~

it works!

scb-vs5 avatar Apr 22 '24 07:04 scb-vs5