openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.78k stars 673 forks source link

Something weird happening with the tox environment and the mvtec path #704

Open jpcbertoldo opened 1 year ago

jpcbertoldo commented 1 year ago

Describe the bug

While trying to run pytest locally i ran into a problem related to the paths inside mvtec.

To Reproduce

I ran pytest using the tox environment locally on the branch main with

# in the anomalib root
tox -e pre_merge_pytest tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py

With the env var ANOMALIB_DATASET_PATH:

ANOMALIB_DATASET_PATH=".../datasets/MVTec"  # "..." is just a simplification
# i also tried
# ANOMALIB_DATASET_PATH=".../datasets/MVTec/bottle"

and got

FAILED tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation] - cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

in the logs i can see

------------------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------------------
[ WARN:0@1.669] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/cluster/CMM/home/jcasagrandebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png'): can't open/read file: check file path/integrity

and

E       cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

Expected behavior

It should be properly finding mvtec's dr.

jpcbertoldo commented 1 year ago

Full logs below

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py F                                                                                                                                     [100%]

===================================================================================================== FAILURES =====================================================================================================
__________________________________________________________________________________________ test_add_images[segmentation] ___________________________________________________________________________________________

dataset = 'segmentation'

    @pytest.mark.parametrize("dataset", ["segmentation"])
    def test_add_images(dataset):
        """Tests if tensorboard logs are generated."""
        with tempfile.TemporaryDirectory() as dir_loc:
            config = OmegaConf.create(
                {
                    "dataset": {"task": dataset},
                    "model": {"threshold": {"image_default": 0.5, "pixel_default": 0.5, "adaptive": True}},
                    "project": {"path": dir_loc},
                    "logging": {"logger": ["tensorboard"]},
                    "visualization": {"log_images": True, "save_images": True},
                    "metrics": {},
                }
            )
            logger = get_dummy_logger(config, dir_loc)
            model = get_dummy_module(config)
            trainer = pl.Trainer(
                callbacks=model.callbacks, logger=logger, checkpoint_callback=False, default_root_dir=config.project.path
            )
>           trainer.test(model=model, datamodule=DummyDataModule())

config     = {'dataset': {'task': 'segmentation'}, 'model': {'threshold': {'image_default': 0.5, 'pixel_default': 0.5, 'adaptive': ...e'}, 'logging': {'logger': ['tensorboard']}, 'visualization': {'log_images': True, 'save_images': True}, 'metrics': {}}
dataset    = 'segmentation'
dir_loc    = '/tmp/tmpocjxyeie'
logger     = <anomalib.utils.loggers.tensorboard.AnomalibTensorBoardLogger object at 0x7f15d28a6040>
model      = DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Dum...): AnomalibMetricCollection,
    prefix=image_
  )
  (pixel_metrics): AnomalibMetricCollection,
    prefix=pixel_
  )
)
trainer    = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py:44: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:938: in test
    return self._call_and_handle_interrupt(self._test_impl, model, dataloaders, ckpt_path, verbose, datamodule)
        ckpt_path  = None
        dataloaders = None
        datamodule = <tests.helpers.dummy.DummyDataModule object at 0x7f13ea97a340>
        model      = DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Dum...): AnomalibMetricCollection,
    prefix=image_
  )
  (pixel_metrics): AnomalibMetricCollection,
    prefix=pixel_
  )
)
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
        verbose    = True
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:723: in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
        args       = (DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Du...cCollection,
    prefix=pixel_
  )
), None, None, True, <tests.helpers.dummy.DummyDataModule object at 0x7f13ea97a340>)
        kwargs     = {}
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
        trainer_fn = <bound method Trainer._test_impl of <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:985: in _test_impl
    results = self._run(model, ckpt_path=self.ckpt_path)
        ckpt_path  = None
        dataloaders = None
        datamodule = <tests.helpers.dummy.DummyDataModule object at 0x7f13ea97a340>
        model      = DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Dum...): AnomalibMetricCollection,
    prefix=image_
  )
  (pixel_metrics): AnomalibMetricCollection,
    prefix=pixel_
  )
)
        model_provided = True
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
        verbose    = True
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:1236: in _run
    results = self._run_stage()
        ckpt_path  = None
        model      = DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Dum...): AnomalibMetricCollection,
    prefix=image_
  )
  (pixel_metrics): AnomalibMetricCollection,
    prefix=pixel_
  )
)
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:1320: in _run_stage
    return self._run_evaluate()
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:1365: in _run_evaluate
    eval_loop_results = self._evaluation_loop.run()
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/loops/base.py:204: in run
    self.advance(*args, **kwargs)
        args       = ()
        kwargs     = {}
        self       = <pytorch_lightning.loops.dataloader.evaluation_loop.EvaluationLoop object at 0x7f13ea97ae80>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py:155: in advance
    dl_outputs = self.epoch_loop.run(self._data_fetcher, dl_max_batches, kwargs)
        args       = ()
        dataloader = <torch.utils.data.dataloader.DataLoader object at 0x7f13ea901550>
        dataloader_idx = 0
        dl_max_batches = 1
        kwargs     = OrderedDict([('batch', tensor([[1.]])), ('batch_idx', 0)])
        self       = <pytorch_lightning.loops.dataloader.evaluation_loop.EvaluationLoop object at 0x7f13ea97ae80>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/loops/base.py:204: in run
    self.advance(*args, **kwargs)
        args       = (<pytorch_lightning.utilities.fetching.DataFetcher object at 0x7f13ea8f4f10>, 1, OrderedDict([('batch', tensor([[1.]])), ('batch_idx', 0)]))
        kwargs     = {}
        self       = <pytorch_lightning.loops.epoch.evaluation_epoch_loop.EvaluationEpochLoop object at 0x7f13ea97ac40>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py:134: in advance
    self._on_evaluation_batch_end(output, **kwargs)
        batch      = tensor([[1.]])
        batch_idx  = 0
        data_fetcher = <pytorch_lightning.utilities.fetching.DataFetcher object at 0x7f13ea8f4f10>
        dl_max_batches = 1
        kwargs     = OrderedDict([('batch', tensor([[1.]])), ('batch_idx', 0)])
        output     = {'anomaly_maps': tensor([[[1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1...ebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png')], 'label': tensor([0.]), ...}
        self       = <pytorch_lightning.loops.epoch.evaluation_epoch_loop.EvaluationEpochLoop object at 0x7f13ea97ac40>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py:267: in _on_evaluation_batch_end
    self.trainer._call_callback_hooks(hook_name, output, *kwargs.values())
        hook_name  = 'on_test_batch_end'
        kwargs     = {'batch': tensor([[1.]]), 'batch_idx': 0, 'dataloader_idx': 0}
        output     = {'anomaly_maps': tensor([[[1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1...ebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png')], 'label': tensor([0.]), ...}
        self       = <pytorch_lightning.loops.epoch.evaluation_epoch_loop.EvaluationEpochLoop object at 0x7f13ea97ac40>
.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:1636: in _call_callback_hooks
    fn(self, self.lightning_module, *args, **kwargs)
        args       = ({'anomaly_maps': tensor([[[1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., ...b-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png')], 'label': tensor([0.]), ...}, tensor([[1.]]), 0, 0)
        callback   = <anomalib.utils.callbacks.visualizer.visualizer_image.ImageVisualizerCallback object at 0x7f13ea97a2e0>
        fn         = <bound method ImageVisualizerCallback.on_test_batch_end of <anomalib.utils.callbacks.visualizer.visualizer_image.ImageVisualizerCallback object at 0x7f13ea97a2e0>>
        hook_name  = 'on_test_batch_end'
        kwargs     = {}
        pl_module  = DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Dum...): AnomalibMetricCollection,
    prefix=image_
  )
  (pixel_metrics): AnomalibMetricCollection,
    prefix=pixel_
  )
)
        prev_fx_name = None
        self       = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
anomalib/utils/callbacks/visualizer/visualizer_image.py:79: in on_test_batch_end
    for i, image in enumerate(self.visualizer.visualize_batch(outputs)):
        _batch     = tensor([[1.]])
        _batch_idx = 0
        _dataloader_idx = 0
        outputs    = {'anomaly_maps': tensor([[[1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1...ebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png')], 'label': tensor([0.]), ...}
        pl_module  = DummyModule(
  (image_threshold): AnomalyScoreThreshold()
  (pixel_threshold): AnomalyScoreThreshold()
  (model): _Dum...): AnomalibMetricCollection,
    prefix=image_
  )
  (pixel_metrics): AnomalibMetricCollection,
    prefix=pixel_
  )
)
        self       = <anomalib.utils.callbacks.visualizer.visualizer_image.ImageVisualizerCallback object at 0x7f13ea97a2e0>
        trainer    = <pytorch_lightning.trainer.trainer.Trainer object at 0x7f13ea97a3d0>
anomalib/post_processing/visualizer.py:79: in visualize_batch
    image=read_image(path=batch["image_path"][i], image_size=(height, width)),
        _num_channels = 3
        batch      = {'anomaly_maps': tensor([[[1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1.,  ..., 1., 1., 1.],
         [1., 1., 1...ebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png')], 'label': tensor([0.]), ...}
        batch_size = 1
        height     = 100
        i          = 0
        self       = <anomalib.post_processing.visualizer.Visualizer object at 0x7f13ea97a220>
        width      = 100
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

path = '/cluster/CMM/home/jcasagrandebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png', image_size = (100, 100)

    def read_image(path: Union[str, Path], image_size: Optional[Union[int, Tuple]] = None) -> np.ndarray:
        """Read image from disk in RGB format.

        Args:
            path (str, Path): path to the image file

        Example:
            >>> image = read_image("test_image.jpg")

        Returns:
            image as numpy array
        """
        path = path if isinstance(path, str) else str(path)
        image = cv2.imread(path)
>       image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
E       cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

image      = None
image_size = (100, 100)
path       = '/cluster/CMM/home/jcasagrandebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png'

anomalib/data/utils/image.py:199: error
----------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------
Testing DataLoader 0:   0%|          | 0/1 [00:00<?, ?it/s]
----------------------------------------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------------------------------------
[ WARN:0@3.133] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/cluster/CMM/home/jcasagrandebertoldo/repos/anomalib-workspace/data/cuda/datasets/MVTec/bottle/broken_large/000.png'): can't open/read file: check file path/integrity
------------------------------------------------------------------------------------------------ Captured log call -------------------------------------------------------------------------------------------------
INFO     pytorch_lightning.utilities.rank_zero:trainer.py:1800 GPU available: True, used: False
INFO     pytorch_lightning.utilities.rank_zero:trainer.py:1805 TPU available: False, using: 0 TPU cores
INFO     pytorch_lightning.utilities.rank_zero:trainer.py:1808 IPU available: False, using: 0 IPUs
INFO     pytorch_lightning.utilities.rank_zero:trainer.py:1811 HPU available: False, using: 0 HPUs
WARNING  pytorch_lightning.loggers.tensorboard:tensorboard.py:300 Missing logger folder: /tmp/tmpocjxyeie/tensorboard_logs
================================================================================================= warnings summary =================================================================================================
.tox/pre_merge_pytest/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:4
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if not hasattr(tensorboard, "__version__") or LooseVersion(

.tox/pre_merge_pytest/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:6
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py:6: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    ) < LooseVersion("1.15"):

.tox/pre_merge_pytest/lib/python3.8/site-packages/comet_ml/monkey_patching.py:19
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/comet_ml/monkey_patching.py:19: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:10
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:10: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _nlv = LooseVersion(_np_version)

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:11
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:11: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _np_version_under1p16 = _nlv < LooseVersion("1.16")

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:12
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:12: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _np_version_under1p17 = _nlv < LooseVersion("1.17")

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:13
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:13: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _np_version_under1p18 = _nlv < LooseVersion("1.18")

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:14
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:14: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _np_version_under1p19 = _nlv < LooseVersion("1.19")

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:15
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/__init__.py:15: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _np_version_under1p20 = _nlv < LooseVersion("1.20")

.tox/pre_merge_pytest/lib/python3.8/site-packages/setuptools/_distutils/version.py:346
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/setuptools/_distutils/version.py:346: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    other = LooseVersion(other)

.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/function.py:125
.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/function.py:125
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pandas/compat/numpy/function.py:125: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(_np_version) >= LooseVersion("1.17.0"):

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/auto_augment.py:39
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/auto_augment.py:39: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
    _RANDOM_INTERPOLATION = (Image.BILINEAR, Image.BICUBIC)

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/auto_augment.py:39
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/auto_augment.py:39: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
    _RANDOM_INTERPOLATION = (Image.BILINEAR, Image.BICUBIC)

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:39
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:39: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
    Image.NEAREST: 'nearest',

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:40
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:40: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
    Image.BILINEAR: 'bilinear',

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:41
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:41: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
    Image.BICUBIC: 'bicubic',

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:42
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:42: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
    Image.BOX: 'box',

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:43
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:43: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
    Image.HAMMING: 'hamming',

.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:44
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/timm/data/transforms.py:44: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
    Image.LANCZOS: 'lanczos',

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation]
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Metric `PrecisionRecallCurve` will save all targets and predictions in buffer. For large datasets this may lead to large memory footprint.
    warnings.warn(*args, **kwargs)

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation]
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py:92: PossibleUserWarning: `max_epochs` was not set. Setting it to 1000 epochs. To train without an epoch limit, set `max_epochs=-1`.
    rank_zero_warn(

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation]
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/callback_connector.py:151: LightningDeprecationWarning: Setting `Trainer(checkpoint_callback=False)` is deprecated in v1.5 and will be removed in v1.7. Please consider using `Trainer(enable_checkpointing=False)`.
    rank_zero_deprecation(

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation]
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py:1814: PossibleUserWarning: GPU available but not used. Set `accelerator` and `devices` using `Trainer(accelerator='gpu', devices=4)`.
    rank_zero_warn(

tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation]
  /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/lib/python3.8/site-packages/pytorch_lightning/trainer/connectors/data_connector.py:240: PossibleUserWarning: The dataloader, test_dataloader 0, does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` (try 32 which is the number of cpus on this machine) in the `DataLoader` init to improve performance.
    rank_zero_warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================================= short test summary info ==============================================================================================
FAILED tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py::test_add_images[segmentation] - cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
========================================================================================== 1 failed, 25 warnings in 9.29s ==========================================================================================
ERROR: InvocationError for command /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/.tox/pre_merge_pytest/bin/python -m pytest tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py --showlocals (exited with code 1)
_____________________________________________________________________________________________________ summary ______________________________________________________________________________________________________
ERROR:   pre_merge_pytest: commands failed

 *  The terminal process "/usr/bin/zsh '-c', 'source /cluster/CMM/home/jcasagrandebertoldo/conda-init-zsh; conda activate anomalib-dev; tox -e pre_merge_pytest /cluster/CMM/home/jcasagrandebertoldo/repos/anomalib/tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 
ashwinvaidya17 commented 5 months ago

@jpcbertoldo is this still relevant with v1.0?