Skip to content

🐞 v1 - Issues when validation and test split modes are set to 'none' #1629

@willyfh

Description

@willyfh

Describe the bug

  • When val_split_mode is set to none > Error: datamodule object has no attribute 'val_data'
  • When test_split_mode is set to none > the test stage is not skipped

Dataset

Other (please specify in the text field below)

Model

Other (please specify in the field below)

Steps to reproduce the behavior

Set val_split_mode or test_split_mode to NONE in a config data file, then start the training process using the config file.

OS information

Expected behavior

when NONE is set to either val_split_mode or test_split_mode, the corresponding stage should be skipped.

Screenshots

No response

Pip/GitHub

pip

What version/branch did you use?

v1

Configuration YAML

class_path: anomalib.data.Kolektor
init_args:
  root: "./datasets/kolektor"
  image_size: [256, 256]
  center_crop: null
  normalization: imagenet
  train_batch_size: 32
  eval_batch_size: 32
  num_workers: 8
  transform_config_train: null
  transform_config_eval: null
  test_split_mode: NONE
  test_split_ratio: 0.2
  val_split_mode: NONE
  val_split_ratio: 0.5
  seed: null

Logs

│ /media/willy/Windows/data_ubuntu/anomalib/anomalib/src/anomalib/data/base/datamodule.py:198 in   │
│ val_dataloader                                                                                   │
│                                                                                                  │
│   195 │   def val_dataloader(self) -> EVAL_DATALOADERS:                                          │
│   196 │   │   """Get validation dataloader."""                                                   │
│   197 │   │   return DataLoader(                                                                 │
│ ❱ 198 │   │   │   dataset=self.val_data,                                                         │
│   199 │   │   │   shuffle=False,                                                                 │
│   200 │   │   │   batch_size=self.eval_batch_size,                                               │
│   201 │   │   │   num_workers=self.num_workers,                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Kolektor' object has no attribute 'val_data'

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions