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.82k stars 679 forks source link

🐞 v1 - Anomalib CLI entrypoint logs are duplicated #1622

Closed samet-akcay closed 9 months ago

samet-akcay commented 10 months ago

Describe the bug

When running anomalib via both API and CLI, the logs are duplicated.

Dataset

MVTec

Model

PADiM

Steps to reproduce the behavior

anomalib fit --model Padim --data MVTe

OS information

OS information:

Expected behavior

Screenshots

No response

Pip/GitHub

GitHub

What version/branch did you use?

v1.0.0

Configuration YAML

N/A

Logs

❯
anomalib fit --model Padim --data MVTec
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find torch. To use this feature, ensure that you have torch installed.
2024-01-11 11:47:52,034 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
[01/11/24 11:47:52] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
Seed set to 1390735007
2024-01-11 11:47:52,416 - anomalib.utils.config - WARNING - Anomalib currently does not support multi-gpu training. Setting devices to 1.
                    WARNING  Anomalib currently does not support multi-gpu training. Setting devices to 1.    config.py:239
[01/11/24 11:47:52] WARNING  Anomalib currently does not support multi-gpu training. Setting devices to 1.    config.py:239
2024-01-11 11:47:52,417 - anomalib.utils.config - INFO -  Setting model input size (256, 256) to dataset size (256, 256).
                    INFO      Setting model input size (256, 256) to dataset size (256, 256).                 config.py:180
                    INFO      Setting model input size (256, 256) to dataset size (256, 256).                 config.py:180
2024-01-11 11:47:52,418 - anomalib.utils.config - INFO - Project path set to results/padim/mvtec/bottle
                    INFO     Project path set to results/padim/mvtec/bottle                                   config.py:116
                    INFO     Project path set to results/padim/mvtec/bottle                                   config.py:116
2024-01-11 11:47:52,447 - anomalib.models.components.base.anomaly_module - INFO - Initializing Padim model.
                    INFO     Initializing Padim model.                                                 anomaly_module.py:36
                    INFO     Initializing Padim model.                                                 anomaly_module.py:36
2024-01-11 11:47:52,672 - timm.models.helpers - INFO - Loading pretrained weights from url (https://download.pytorch.org/models/resnet18-5c106cde.pth)
                    INFO     Loading pretrained weights from url                                             helpers.py:247
                             (https://download.pytorch.org/models/resnet18-5c106cde.pth)
                    INFO     Loading pretrained weights from url                                             helpers.py:247
                             (https://download.pytorch.org/models/resnet18-5c106cde.pth)
2024-01-11 11:47:52,741 - anomalib.data.utils.transforms - INFO - No config file has been provided. Using default transforms.
                    INFO     No config file has been provided. Using default transforms.                  transforms.py:130
                    INFO     No config file has been provided. Using default transforms.                  transforms.py:130
2024-01-11 11:47:52,743 - anomalib.data.utils.transforms - INFO - No config file has been provided. Using default transforms.
                    INFO     No config file has been provided. Using default transforms.                  transforms.py:130
                    INFO     No config file has been provided. Using default transforms.                  transforms.py:130
2024-01-11 11:47:52,744 - anomalib.callbacks - INFO - Loading the callbacks
                    INFO     Loading the callbacks                                                           __init__.py:45
                    INFO     Loading the callbacks                                                           __init__.py:45
2024-01-11 11:47:52,745 - anomalib.engine.engine - INFO - Overriding max_epochs from None with 1 for Padim
                    INFO     Overriding max_epochs from None with 1 for Padim                                  engine.py:81
                    INFO     Overriding max_epochs from None with 1 for Padim                                  engine.py:81
2024-01-11 11:47:52,746 - anomalib.engine.engine - INFO - Overriding val_check_interval from None with 1.0 for Padim
                    INFO     Overriding val_check_interval from None with 1.0 for Padim                        engine.py:81
                    INFO     Overriding val_check_interval from None with 1.0 for Padim                        engine.py:81
2024-01-11 11:47:52,746 - anomalib.engine.engine - INFO - Overriding num_sanity_val_steps from None with 0 for Padim
                    INFO     Overriding num_sanity_val_steps from None with 0 for Padim                        engine.py:81
                    INFO     Overriding num_sanity_val_steps from None with 0 for Padim                        engine.py:81
2024-01-11 11:47:52,870 - anomalib.data.image.mvtec - INFO - Found the dataset.
                    INFO     Found the dataset.                                                                mvtec.py:413
                    INFO     Found the dataset.                                                                mvtec.py:413
Epoch 0:   0%|                                                                                       | 0/7 [00:00<?, ?it/s]Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,627 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:47:59,628 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.                                                        [01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.

[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:47:59] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
Epoch 0: 100%|██████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00,  0.95it/s, v_num=52024-01-11 11:48:00,636 - anomalib.models.image.padim.lightning_model - INFO - Aggregating the embedding extracted from the training set.
[01/11/24 11:48:00] INFO     Aggregating the embedding extracted from the training set.               lightning_model.py:88
[01/11/24 11:48:00] INFO     Aggregating the embedding extracted from the training set.               lightning_model.py:88
2024-01-11 11:48:00,665 - anomalib.models.image.padim.lightning_model - INFO - Fitting a Gaussian to the embedding collected from the training set.
                    INFO     Fitting a Gaussian to the embedding collected from the training set.     lightning_model.py:91
                    INFO     Fitting a Gaussian to the embedding collected from the training set.     lightning_model.py:91
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
Could not find torch. To use this feature, ensure that you have torch installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
2024-01-11 11:48:06,963 - anomalib.utils.exceptions.imports - WARNING - Could not find comet_ml. To use this feature, ensure that you have comet_ml installed.
[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.                                                        [01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.

[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
[01/11/24 11:48:06] WARNING  Could not find comet_ml. To use this feature, ensure that you have comet_ml      imports.py:25
                             installed.
Epoch 0: 100%|██████████████████████████████████████████████████████████████████████| 7/7 [00:15<00:00,  0.46it/s, v_num=5]
2024-01-11 11:48:58,503 - anomalib.callbacks.timer - INFO - Training took 65.47 seconds
[01/11/24 11:48:58] INFO     Training took 65.47 seconds                                                        timer.py:59
[01/11/24 11:48:58] INFO     Training took 65.47 seconds

Code of Conduct

rghvsh commented 9 months ago

Hey @samet-akcay @ashwinvaidya17 ! Is this issue up for grabs? I don't have the same OS does that matter?

samet-akcay commented 9 months ago

Hi @rghvsh, #1748 might potentially address this. I need to double check though

samet-akcay commented 9 months ago

I have checked this on Linux and MacOS, and it seems to be resolved with #1748

rghvsh commented 9 months ago

That's great! Was looking for some good first issues to work on will find something else.

Cheers Raghav

samet-akcay commented 9 months ago

Sure, thanks! I'll add some more issues soon