Skip to content

Commit

Permalink
TensorRT 7 export fix (#6235)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Jan 7, 2022
1 parent 33a67b4 commit 6865d19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion export.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def export_engine(model, im, file, train, half, simplify, workspace=4, verbose=F
check_requirements(('tensorrt',))
import tensorrt as trt

if trt.__version__[0] == 7: # TensorRT 7 handling https://github.com/ultralytics/yolov5/issues/6012
if trt.__version__[0] == '7': # TensorRT 7 handling https://github.com/ultralytics/yolov5/issues/6012
grid = model.model[-1].anchor_grid
model.model[-1].anchor_grid = [a[..., :1, :1, :] for a in grid]
export_onnx(model, im, file, 12, train, False, simplify) # opset 12
Expand Down

0 comments on commit 6865d19

Please sign in to comment.