Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU export options #2297

Merged
merged 7 commits into from
Mar 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup 2
  • Loading branch information
glenn-jocher authored Mar 6, 2021
commit b482563553f4587baa5f86a64be707ab8c9083c3
4 changes: 2 additions & 2 deletions models/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
parser.add_argument('--img-size', nargs='+', type=int, default=[640, 640], help='image size') # height, width
parser.add_argument('--batch-size', type=int, default=1, help='batch size')
parser.add_argument('--dynamic', action='store_true', help='dynamic ONNX axes')
parser.add_argument('--skip-grid', action='store_true', help='skip Detect() layer grid computation')
parser.add_argument('--no-grid', action='store_true', help='no Detect() layer grid computation')
parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
opt = parser.parse_args()
opt.img_size *= 2 if len(opt.img_size) == 1 else 1 # expand
Expand Down Expand Up @@ -55,7 +55,7 @@
m.act = SiLU()
# elif isinstance(m, models.yolo.Detect):
# m.forward = m.forward_export # assign forward (optional)
model.model[-1].export = not opt.skip_grid # set Detect() layer export Boolean
model.model[-1].export = not opt.no_grid # set Detect() layer grid export
y = model(img) # dry run

# TorchScript export
Expand Down