Skip to content

More Efficient Keypoint Export #54

More Efficient Keypoint Export

More Efficient Keypoint Export #54

GitHub Actions / Test Results failed May 16, 2024 in 0s

25 errors, 7 fail, 25 pass in 39m 30s

  6 files    6 suites   39m 30s ⏱️
 57 tests  25 ✅ 0 💤  7 ❌  25 🔥
342 runs  178 ✅ 0 💤 14 ❌ 150 🔥

Results for commit b94ea86.

Annotations

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_sanity[resnet_model.yaml] (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 17s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 18s]
Raw output
IndexError: list index out of range
config_file = 'resnet_model.yaml'

    @pytest.mark.parametrize(
        "config_file", [path for path in os.listdir("configs") if "model" in path]
    )
    def test_sanity(config_file):
        opts = [
            "trainer.epochs",
            "1",
            "trainer.validation_interval",
            "1",
            "trainer.callbacks",
            "[]",
        ]
        result = subprocess.run(
            ["luxonis_train", "train", "--config", f"configs/{config_file}", *opts],
        )
        assert result.returncode == 0
    
>       opts += ["model.weights", str(list(Path("output").rglob("*.ckpt"))[0])]
E       IndexError: list index out of range

tests/integration/test_sanity.py:31: IndexError

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_sanity[coco_model.yaml] (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 4s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 5s]
Raw output
IndexError: list index out of range
config_file = 'coco_model.yaml'

    @pytest.mark.parametrize(
        "config_file", [path for path in os.listdir("configs") if "model" in path]
    )
    def test_sanity(config_file):
        opts = [
            "trainer.epochs",
            "1",
            "trainer.validation_interval",
            "1",
            "trainer.callbacks",
            "[]",
        ]
        result = subprocess.run(
            ["luxonis_train", "train", "--config", f"configs/{config_file}", *opts],
        )
        assert result.returncode == 0
    
>       opts += ["model.weights", str(list(Path("output").rglob("*.ckpt"))[0])]
E       IndexError: list index out of range

tests/integration/test_sanity.py:31: IndexError

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_sanity[keypoint_bbox_model.yaml] (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 3s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 4s]
Raw output
IndexError: list index out of range
config_file = 'keypoint_bbox_model.yaml'

    @pytest.mark.parametrize(
        "config_file", [path for path in os.listdir("configs") if "model" in path]
    )
    def test_sanity(config_file):
        opts = [
            "trainer.epochs",
            "1",
            "trainer.validation_interval",
            "1",
            "trainer.callbacks",
            "[]",
        ]
        result = subprocess.run(
            ["luxonis_train", "train", "--config", f"configs/{config_file}", *opts],
        )
        assert result.returncode == 0
    
>       opts += ["model.weights", str(list(Path("output").rglob("*.ckpt"))[0])]
E       IndexError: list index out of range

tests/integration/test_sanity.py:31: IndexError

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_sanity[segmentation_model.yaml] (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 3s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 3s]
Raw output
IndexError: list index out of range
config_file = 'segmentation_model.yaml'

    @pytest.mark.parametrize(
        "config_file", [path for path in os.listdir("configs") if "model" in path]
    )
    def test_sanity(config_file):
        opts = [
            "trainer.epochs",
            "1",
            "trainer.validation_interval",
            "1",
            "trainer.callbacks",
            "[]",
        ]
        result = subprocess.run(
            ["luxonis_train", "train", "--config", f"configs/{config_file}", *opts],
        )
        assert result.returncode == 0
    
>       opts += ["model.weights", str(list(Path("output").rglob("*.ckpt"))[0])]
E       IndexError: list index out of range

tests/integration/test_sanity.py:31: IndexError

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_sanity[detection_model.yaml] (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 3s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 4s]
Raw output
IndexError: list index out of range
config_file = 'detection_model.yaml'

    @pytest.mark.parametrize(
        "config_file", [path for path in os.listdir("configs") if "model" in path]
    )
    def test_sanity(config_file):
        opts = [
            "trainer.epochs",
            "1",
            "trainer.validation_interval",
            "1",
            "trainer.callbacks",
            "[]",
        ]
        result = subprocess.run(
            ["luxonis_train", "train", "--config", f"configs/{config_file}", *opts],
        )
        assert result.returncode == 0
    
>       opts += ["model.weights", str(list(Path("output").rglob("*.ckpt"))[0])]
E       IndexError: list index out of range

tests/integration/test_sanity.py:31: IndexError

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_sanity[classification_model.yaml] (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 3s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 3s]
Raw output
IndexError: list index out of range
config_file = 'classification_model.yaml'

    @pytest.mark.parametrize(
        "config_file", [path for path in os.listdir("configs") if "model" in path]
    )
    def test_sanity(config_file):
        opts = [
            "trainer.epochs",
            "1",
            "trainer.validation_interval",
            "1",
            "trainer.callbacks",
            "[]",
        ]
        result = subprocess.run(
            ["luxonis_train", "train", "--config", f"configs/{config_file}", *opts],
        )
        assert result.returncode == 0
    
>       opts += ["model.weights", str(list(Path("output").rglob("*.ckpt"))[0])]
E       IndexError: list index out of range

tests/integration/test_sanity.py:31: IndexError

Check warning on line 0 in tests.integration.test_sanity

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 6 runs failed: test_tuner (tests.integration.test_sanity)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 3s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 4s]
Raw output
AssertionError: assert 1 == 0
 +  where 1 = CompletedProcess(args=['luxonis_train', 'tune', '--config', 'configs/example_tuning.yaml', 'trainer.epochs', '1', 'trainer.validation_interval', '1', 'trainer.callbacks', '[]', 'tuner.n_trials', '4'], returncode=1).returncode
def test_tuner():
        Path("study_local.db").unlink(missing_ok=True)
        result = subprocess.run(
            [
                "luxonis_train",
                "tune",
                "--config",
                "configs/example_tuning.yaml",
                "trainer.epochs",
                "1",
                "trainer.validation_interval",
                "1",
                "trainer.callbacks",
                "[]",
                "tuner.n_trials",
                "4",
            ],
        )
>       assert result.returncode == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = CompletedProcess(args=['luxonis_train', 'tune', '--config', 'configs/example_tuning.yaml', 'trainer.epochs', '1', 'trainer.validation_interval', '1', 'trainer.callbacks', '[]', 'tuner.n_trials', '4'], returncode=1).returncode

tests/integration/test_sanity.py:85: AssertionError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_creation_0_ClassificationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 19s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 17s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 19s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 22s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_creation_1_EfficientBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_creation_2_ImplicitKeypointBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_creation_3_SegmentationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_creation_4_BiSeNetHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_contents_0_ClassificationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_contents_1_EfficientBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_contents_2_ImplicitKeypointBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_contents_3_SegmentationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_archive_contents_4_BiSeNetHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_onnx_0_ClassificationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_onnx_1_EfficientBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_onnx_2_ImplicitKeypointBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_onnx_3_SegmentationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_onnx_4_BiSeNetHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_config_io_0_ClassificationHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_config_io_1_EfficientBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError

Check failure on line 0 in tests.unittests.test_core.test_archiver.TestArchiver

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 6 runs with error: test_config_io_2_ImplicitKeypointBBoxHead (tests.unittests.test_core.test_archiver.TestArchiver)

artifacts/Test Results [macOS-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [macOS-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [ubuntu-latest] (Python 3.11)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.10)/pytest.xml [took 0s]
artifacts/Test Results [windows-latest] (Python 3.11)/pytest.xml [took 0s]
Raw output
failed on setup with "pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
model.heads.0.HeadClassification.family
  Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadClassification.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetection.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionYOLO.family
  Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadObjectDetectionSSD.family
  Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadObjectDetectionSSD.outputs.boxes
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.scores
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadObjectDetectionSSD.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadSegmentation.family
  Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadSegmentation.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.family
  Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/literal_error
model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
  Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
  Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
  Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden"
cls = <class 'unittests.test_core.test_archiver.TestArchiver'>

    @classmethod
    def setup_class(cls):
        """Creates all files required for testing."""
    
        # make tmp dir
        luxonis_train_parent_dir = os.path.dirname(
            os.path.dirname(luxonis_train.__file__)
        )
        cls.tmp_path = os.path.join(
            luxonis_train_parent_dir, "tests", "unittests", "test_core", "tmp"
        )
        os.mkdir(cls.tmp_path)
    
        # make LDFs
        unilabelLDF = "dummyLDF_unilabel"
        cls._make_dummy_ldf(
            ldf_name=unilabelLDF,
            save_path=cls.tmp_path,
            bbx_anno=True,
            kpt_anno=True,
        )
        multilabelLDF = "dummyLDF_multilabel"
        cls._make_dummy_ldf(
            ldf_name=multilabelLDF,
            save_path=cls.tmp_path,
            cls_anno=True,
            bbx_anno=True,
            sgm_anno=True,
            multilabel=True,
        )
        cls.ldf_names = [unilabelLDF, multilabelLDF]
    
        for head_name in HEAD_NAMES:
            if head_name == "ImplicitKeypointBBoxHead":
                ldf_name = unilabelLDF  # multiclass keypoint detection not yet supported in luxonis-train
            else:
                ldf_name = multilabelLDF
    
            # make config
            cfg_dict = cls._make_dummy_cfg_dict(
                head_name=head_name,
                save_path=cls.tmp_path,
                ldf_name=ldf_name,
            )
            cfg = Config.get_config(cfg_dict)
    
            # train model
            cfg.trainer.epochs = 1
            cfg.trainer.validation_interval = 1
            cfg.trainer.batch_size = 1
            trainer = Trainer(cfg=cfg)
            trainer.train()
            callbacks = [
                c
                for c in trainer.pl_trainer.callbacks
                if isinstance(c, pl.callbacks.ModelCheckpoint)
            ]
            model_checkpoint_path = callbacks[0].best_model_path
            model_ckpt = os.path.join(trainer.run_save_dir, model_checkpoint_path)
            trainer.reset_logging()
    
            # export model to ONNX
            cfg.model.weights = model_ckpt
            exporter = Exporter(cfg=cfg)
            cls.onnx_model_path = os.path.join(cls.tmp_path, "model.onnx")
            exporter.export(onnx_path=cls.onnx_model_path)
            exporter.reset_logging()
    
            # make archive
            cfg.archiver.archive_save_directory = cls.tmp_path
            cfg.archiver.archive_name = f"nnarchive_{head_name}"
            archiver = Archiver(cfg=cfg)
>           cls.archive_path = archiver.archive(cls.onnx_model_path)

tests/unittests/test_core/test_archiver.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
luxonis_train/core/archiver.py:114: in archive
    self.archive_path = ArchiveGenerator(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <luxonis_ml.nn_archive.archive_generator.ArchiveGenerator object at 0x7fad98f0cbb0>
archive_name = 'nnarchive_ImplicitKeypointBBoxHead_onnx'
save_path = '/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp'
cfg_dict = {'config_version': '1.0', 'model': {'heads': [{'anchors': [[[...], [...], [...]], [[...], [...], [...]], [[...], [...]...oxHead', 'path': 'model.onnx'}, 'outputs': [{'dtype': 'float32', 'name': 'kpt_detection_head/boxes_and_keypoints/0'}]}}
executables_paths = ['/home/runner/work/luxonis-train/luxonis-train/tests/unittests/test_core/tmp/model.onnx']
compression = 'xz'

    def __init__(
        self,
        archive_name: str,
        save_path: str,
        cfg_dict: dict,
        executables_paths: List[str],
        compression: Literal["xz", "gz", "bz2"] = "xz",
    ):
        self.save_path = save_path
        self.executables_paths = executables_paths
    
        if compression not in ["xz", "gz", "bz2"]:
            raise ValueError(
                "Invalid compression type. Must be one of 'xz', 'gz', 'bz2'."
            )
        self.compression = compression
    
        self.archive_name = (
            archive_name
            if archive_name.endswith(f".tar.{self.compression}")
            else f"{archive_name}.tar.{self.compression}"
        )
    
>       self.cfg = Config(  # pydantic config check
            config_version=cfg_dict["config_version"], model=cfg_dict["model"]
        )
E       pydantic_core._pydantic_core.ValidationError: 23 validation errors for Config
E       model.heads.0.HeadClassification.family
E         Input should be 'Classification' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadClassification.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetection.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionYOLO.family
E         Input should be 'ObjectDetectionYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadObjectDetectionSSD.family
E         Input should be 'ObjectDetectionSSD' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadObjectDetectionSSD.outputs.boxes
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.scores
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadObjectDetectionSSD.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadSegmentation.family
E         Input should be 'Segmentation' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadSegmentation.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.family
E         Input should be 'InstanceSegmentationYOLO' [type=literal_error, input_value='KeypointDetectionYOLO', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/literal_error
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.mask_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.protos
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden
E       model.heads.0.HeadInstanceSegmentationYOLO.is_softmax
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.postprocessor_path
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadInstanceSegmentationYOLO.n_prototypes
E         Field required [type=missing, input_value={'family': 'KeypointDetec..., 11.037925720214844]]]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.yolo_outputs
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.keypoints
E         Field required [type=missing, input_value={'predictions': 'kpt_dete.../boxes_and_keypoints/0'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.7/v/missing
E       model.heads.0.HeadKeypointDetectionYOLO.outputs.predictions
E         Extra inputs are not permitted [type=extra_forbidden, input_value='kpt_detection_head/boxes_and_keypoints/0', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/luxonis_ml/nn_archive/archive_generator.py:50: ValidationError