Skip to content

Commit

Permalink
Change the output names list of YOLOv6 export to be dynamic (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaCuhel authored Sep 24, 2024
1 parent 85db845 commit b6e79e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yolo/export_yolov6.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def export_onnx(self):
training=torch.onnx.TrainingMode.EVAL,
do_constant_folding=True,
input_names=['images'],
output_names=['output1_yolov6r2', 'output2_yolov6r2', 'output3_yolov6r2'],
output_names=[f"output{i+1}_yolov6r2" for i in range(self.num_branches)],
dynamic_axes=None)

# check if the arhcitecture is correct
Expand Down
2 changes: 1 addition & 1 deletion yolov6r3/yolo/export_gold_yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def export_onnx(self):
training=torch.onnx.TrainingMode.EVAL,
do_constant_folding=True,
input_names=['images'],
output_names=['output1_yolov6r2', 'output2_yolov6r2', 'output3_yolov6r2'],
output_names=[f"output{i+1}_yolov6r2" for i in range(self.num_branches)],
dynamic_axes=None)

# check if the arhcitecture is correct
Expand Down
2 changes: 1 addition & 1 deletion yolov6r3/yolo/export_yolov6_r3.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def export_onnx(self):
training=torch.onnx.TrainingMode.EVAL,
do_constant_folding=True,
input_names=['images'],
output_names=['output1_yolov6r2', 'output2_yolov6r2', 'output3_yolov6r2'],
output_names=[f"output{i+1}_yolov6r2" for i in range(self.num_branches)],
dynamic_axes=None)

# check if the arhcitecture is correct
Expand Down

0 comments on commit b6e79e1

Please sign in to comment.