We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5fa5e3 commit a821d9bCopy full SHA for a821d9b
packages/train-yolo/main.py
@@ -335,6 +335,13 @@ def main(
335
name=run_name,
336
)
337
338
+ if batch < 0:
339
+ # If batch size is set to -1, ultralytics uses the maximum batch size
340
+ # that fits in the GPU memory. We need to get the actual batch size
341
+ # used, as it will be needed later during validation.
342
+ # The actual batch size is stored in model.trainer.args.batch
343
+ batch = model.trainer.args.batch
344
+
345
# Export the trained model to ONNX and TensorRT format
346
model.export(
347
format="onnx",
0 commit comments