Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion luxonis_train/core/utils/archive_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
@param nodes: Dictionary of nodes.
"""
heads = []

head_names = set()
for node in cfg.model.nodes:
node_name = node.name
node_alias = node.alias or node_name
Expand All @@ -250,7 +250,13 @@
head_outputs = _get_head_outputs(
outputs, node_alias, node_name
)
if node_alias in head_names:
curr_head_name = f"{node_alias}_{len(head_names)}" # add suffix if name is already present

Check warning on line 254 in luxonis_train/core/utils/archive_utils.py

View check run for this annotation

Codecov / codecov/patch

luxonis_train/core/utils/archive_utils.py#L254

Added line #L254 was not covered by tests
else:
curr_head_name = node_alias
head_names.add(curr_head_name)
head_dict = {
"name": curr_head_name,
"parser": parser,
"metadata": {
"classes": classes,
Expand Down
21 changes: 17 additions & 4 deletions luxonis_train/models/luxonis_lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,15 @@ def _initiate_nodes(
for source_name, shape in shapes.items()
}

for node_name, (
Node,
node_kwargs,
), node_input_names, _ in traverse_graph(self.graph, nodes):
for (
node_name,
(
Node,
node_kwargs,
),
node_input_names,
_,
) in traverse_graph(self.graph, nodes):
node_dummy_inputs: list[Packet[Tensor]] = []
"""List of dummy input packets for the node.

Expand Down Expand Up @@ -530,6 +535,14 @@ def export_onnx(self, save_path: str, **kwargs) -> list[str]:
for node_name, output_name, i in output_order
]

if not self.cfg.exporter.output_names:
idx = 1
# Set to output names required by DAI
for i, output_name in enumerate(output_names):
if output_name.startswith("EfficientBBoxHead"):
output_names[i] = f"output{idx}_yolov6r2"
idx += 1

old_forward = self.forward

def export_forward(inputs) -> tuple[Tensor, ...]:
Expand Down