Skip to content

Commit 3fc8cb4

Browse files
committed
fix test
1 parent 478046c commit 3fc8cb4

8 files changed

Lines changed: 16 additions & 6 deletions

File tree

luxonis_train/nodes/backbones/dinov3/dinov3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def _get_backbone(
206206
model=model_name,
207207
weights=weights,
208208
source="github",
209+
trust_repo=True, # type: ignore
209210
**kwargs,
210211
)
211212

luxonis_train/nodes/backbones/efficientnet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class GenEfficientNet(nn.Module):
4343
"rwightman/gen-efficientnet-pytorch",
4444
"efficientnet_lite0",
4545
pretrained=weights == "download",
46+
trust_repo=True, # type: ignore
4647
),
4748
)
4849
self.out_indices = out_indices or [0, 1, 2, 4, 6]

luxonis_train/utils/dataset_metadata.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def n_classes(self, task_name: str | None = None) -> int:
103103
if task_name is not None:
104104
if task_name not in self._classes:
105105
raise ValueError(
106-
f"Task '{task_name}' is not present in the dataset."
106+
f"Task '{task_name}' is not present in the dataset. "
107+
f"Available tasks: {self.task_names}"
107108
)
108109
return len(self._classes[task_name])
109110
n_classes = len(next(iter(self._classes.values())))
@@ -155,7 +156,8 @@ def classes(self, task_name: str | None = None) -> bidict[str, int]:
155156
if task_name is not None:
156157
if task_name not in self._classes:
157158
raise ValueError(
158-
f"Task '{task_name}' is not present in the dataset."
159+
f"Task '{task_name}' is not present in the dataset. "
160+
f"Available tasks: {self.task_names}"
159161
)
160162
return bidict(self._classes[task_name])
161163
classes = next(iter(self._classes.values()))

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def opts(save_dir: Path, image_size: tuple[int, int]) -> Params:
406406
"tracker.save_directory": str(save_dir),
407407
"trainer.preprocessing.train_image_size": image_size,
408408
"exporter.aimet": {
409-
"active": True,
409+
"active": False,
410410
"epochs": 1,
411411
"fold_batch_norms": True,
412412
"batch_norm_reestimation": True,

tests/integration/test_callbacks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def test_callbacks(coco_dataset: LuxonisDataset, opts: Params, save_dir: Path):
5656
"exporter.scale_values": [0.5, 0.5, 0.5],
5757
"exporter.mean_values": [0.5, 0.5, 0.5],
5858
"exporter.blobconverter.active": True,
59+
# AIMET fails when determinism is enabled
60+
"exporter.aimet.active": False,
5961
"loader.params.dataset_name": coco_dataset.identifier,
6062
}
6163
model = LuxonisModel(config_file, opts, debug_mode=True)

tests/integration/test_combinations.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ def test_combinations(
143143
subtests: SubTests,
144144
):
145145
config = get_config(backbone, dinov3_weights)
146-
opts |= {"loader.params.dataset_name": parking_lot_dataset.identifier}
146+
opts |= {
147+
"loader.params.dataset_name": parking_lot_dataset.identifier,
148+
}
147149
model = LuxonisModel(config, opts)
148150

149151
with subtests.test("train"):

tests/integration/test_custom_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def input_shapes(self):
3030
"pointcloud": torch.Size([self.n_points, 3]),
3131
}
3232

33-
def get(self, _: int) -> LuxonisLoaderTorchOutput:
33+
def __getitem__(self, _: int) -> LuxonisLoaderTorchOutput:
3434
left = torch.rand(3, self.height, self.width, dtype=torch.float32)
3535
right = torch.rand(3, self.height, self.width, dtype=torch.float32)
3636
disparity = torch.rand(1, self.height, self.width, dtype=torch.float32)

tests/integration/test_predefined_models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def test_predefined_models(
4848
tmp_path = tmp_path / config_name
4949
tmp_path.mkdir()
5050

51-
model = LuxonisModel(config_file, opts | extra_opts)
51+
model = LuxonisModel(
52+
config_file, opts | extra_opts | {"exporter.aimet.active": True}
53+
)
5254

5355
with subtests.test("train"):
5456
model.train()

0 commit comments

Comments
 (0)