You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(base) (.venv) PS C:\patch\anomalib> python tools/train.py --config C:\patch\anomalib\src\anomalib\models\patchcore\config.yaml C:\patch\anomalib\src\anomalib\config\config.py:243: UserWarning: The seed value is now fixed to 0. Up to v0.3.7, the seed was not fixed when the se ed value was set to 0. If you want to use the random seed, please select None for the seed value (nullin the YAML file) or remove theseedke y from the YAML file. warn( C:\patch\anomalib\src\anomalib\config\config.py:280: UserWarning: config.project.unique_dir is set to False. This does not ensure that your results will be written in an empty directory and you may overwrite files. warn( Global seed set to 0 2024-03-15 13:18:03,083 - anomalib.data - INFO - Loading the datamodule 2024-03-15 13:18:03,083 - anomalib.data.utils.transform - INFO - No config file has been provided. Using default transforms. 2024-03-15 13:18:03,084 - anomalib.data.utils.transform - INFO - No config file has been provided. Using default transforms. 2024-03-15 13:18:03,084 - anomalib.models - INFO - Loading the model. 2024-03-15 13:18:03,085 - anomalib.models.components.base.anomaly_module - INFO - Initializing PatchcoreLightning model. C:\patch\anomalib\.venv\Lib\site-packages\torchmetrics\utilities\prints.py:36: UserWarning: MetricPrecisionRecallCurvewill save all targets and predictions in buffer. For large datasets this may lead to large memory footprint. warnings.warn(*args, **kwargs) 2024-03-15 13:18:03,090 - anomalib.models.components.feature_extractors.timm - WARNING - FeatureExtractor is deprecated. Use TimmFeatureExtractor in stead. Both FeatureExtractor and TimmFeatureExtractor will be removed in a future release. 2024-03-15 13:18:04,746 - timm.models.helpers - INFO - Loading pretrained weights from url (https://github.com/rwightman/pytorch-image-models/releas es/download/v0.1-weights/wide_resnet50_racm-8234f177.pth) 2024-03-15 13:18:04,964 - anomalib.utils.loggers - INFO - Loading the experiment logger(s) 2024-03-15 13:18:04,965 - anomalib.utils.callbacks - INFO - Loading the callbacks C:\patch\anomalib\src\anomalib\utils\callbacks\__init__.py:153: UserWarning: Export option: None not found. Defaulting to no model export warnings.warn(f"Export option: {config.optimization.export_mode} not found. Defaulting to no model export") 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - GPU available: False, used: False 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - TPU available: False, using: 0 TPU cores 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - IPU available: False, using: 0 IPUs 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - HPU available: False, using: 0 HPUs 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -Trainer(limit_train_batches=1.0)was configured so 100% of the batches pe r epoch will be used.. 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -Trainer(limit_val_batches=1.0)was configured so 100% of the batches will be used.. 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -Trainer(limit_test_batches=1.0)was configured so 100% of the batches wil l be used.. 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -Trainer(limit_predict_batches=1.0)was configured so 100% of the batches will be used.. 2024-03-15 13:18:04,980 - pytorch_lightning.utilities.rank_zero - INFO -Trainer(val_check_interval=1.0)was configured so validation will run at the end of the training epoch.. 2024-03-15 13:18:04,980 - anomalib - INFO - Training the model. 2024-03-15 13:18:04,986 - anomalib.data.mvtec - INFO - Found the dataset. Traceback (most recent call last): File "C:\patch\anomalib\tools\train.py", line 86, in <module> train(args) File "C:\patch\anomalib\tools\train.py", line 71, in train trainer.fit(model=model, datamodule=datamodule) File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 608, in fit call._call_and_handle_interrupt( File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\call.py", line 38, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 650, in _fit_impl self._run(model, ckpt_path=self.ckpt_path) File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1051, in _run self._call_setup_hook() # allow user to setup lightning_module in accelerator environment ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1298, in _call_setup_hook self._call_lightning_datamodule_hook("setup", stage=fn) File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1375, in _call_lightning_datamodule_hook return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\src\anomalib\data\base\datamodule.py", line 111, in setup self._setup(stage) File "C:\patch\anomalib\src\anomalib\data\base\datamodule.py", line 127, in _setup self.train_data.setup() File "C:\patch\anomalib\src\anomalib\data\base\dataset.py", line 162, in setup self._setup() File "C:\patch\anomalib\src\anomalib\data\mvtec.py", line 196, in _setup self.samples = make_mvtec_dataset(self.root_category, split=self.split, extensions=IMG_EXTENSIONS) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\src\anomalib\data\mvtec.py", line 151, in make_mvtec_dataset samples.loc[ File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 894, in __setitem__ iloc._setitem_with_indexer(indexer, value, self.name) File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 1902, in _setitem_with_indexer iloc._setitem_with_indexer(indexer, value, self.name) File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 1902, in _setitem_with_indexer self._setitem_with_indexer_split_path(indexer, value, name) self._setitem_with_indexer_split_path(indexer, value, name) File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 1958, in _setitem_with_indexer_split_path raise ValueError( ValueError: Must have equal len keys and value when setting with an iterable
`dataset:
name: mvtec
format: mydata
path: ./datasets/MVTec
task: segmentation
category: bottle
train_batch_size: 32
eval_batch_size: 32
num_workers: 8
image_size: 256 # dimensions to which images are resized (mandatory)
center_crop: 224 # dimensions to which images are center-cropped after resizing (optional)
normalization: imagenet # data distribution to which the images will be normalized: [none, imagenet]
transform_config:
train: null
eval: null
test_split_mode: from_dir # options: [from_dir, synthetic]
test_split_ratio: 0.2 # fraction of train images held out testing (usage depends on test_split_mode)
val_split_mode: same_as_test # options: [same_as_test, from_test, synthetic]
val_split_ratio: 0.5 # fraction of train/test images held out for validation (usage depends on val_split_mode)
tiling:
apply: false
tile_size: null
stride: null
remove_border_count: 0
use_random_tiling: False
random_tile_count: 16
visualization:
show_images: False # show images on the screen
save_images: True # save images to the file system
log_images: True # log images to the available loggers (if any)
image_save_path: null # path to which images will be saved
mode: full # options: ["full", "simple"]
project:
seed: 0
path: ./results
logging:
logger: [] # options: [comet, tensorboard, wandb, csv] or combinations.
log_graph: false # Logs the model graph to respective logger.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
(base) (.venv) PS C:\patch\anomalib> python tools/train.py --config C:\patch\anomalib\src\anomalib\models\patchcore\config.yaml C:\patch\anomalib\src\anomalib\config\config.py:243: UserWarning: The seed value is now fixed to 0. Up to v0.3.7, the seed was not fixed when the se ed value was set to 0. If you want to use the random seed, please select
Nonefor the seed value (
nullin the YAML file) or remove the
seedke y from the YAML file. warn( C:\patch\anomalib\src\anomalib\config\config.py:280: UserWarning: config.project.unique_dir is set to False. This does not ensure that your results will be written in an empty directory and you may overwrite files. warn( Global seed set to 0 2024-03-15 13:18:03,083 - anomalib.data - INFO - Loading the datamodule 2024-03-15 13:18:03,083 - anomalib.data.utils.transform - INFO - No config file has been provided. Using default transforms. 2024-03-15 13:18:03,084 - anomalib.data.utils.transform - INFO - No config file has been provided. Using default transforms. 2024-03-15 13:18:03,084 - anomalib.models - INFO - Loading the model. 2024-03-15 13:18:03,085 - anomalib.models.components.base.anomaly_module - INFO - Initializing PatchcoreLightning model. C:\patch\anomalib\.venv\Lib\site-packages\torchmetrics\utilities\prints.py:36: UserWarning: Metric
PrecisionRecallCurvewill save all targets and predictions in buffer. For large datasets this may lead to large memory footprint. warnings.warn(*args, **kwargs) 2024-03-15 13:18:03,090 - anomalib.models.components.feature_extractors.timm - WARNING - FeatureExtractor is deprecated. Use TimmFeatureExtractor in stead. Both FeatureExtractor and TimmFeatureExtractor will be removed in a future release. 2024-03-15 13:18:04,746 - timm.models.helpers - INFO - Loading pretrained weights from url (https://github.com/rwightman/pytorch-image-models/releas es/download/v0.1-weights/wide_resnet50_racm-8234f177.pth) 2024-03-15 13:18:04,964 - anomalib.utils.loggers - INFO - Loading the experiment logger(s) 2024-03-15 13:18:04,965 - anomalib.utils.callbacks - INFO - Loading the callbacks C:\patch\anomalib\src\anomalib\utils\callbacks\__init__.py:153: UserWarning: Export option: None not found. Defaulting to no model export warnings.warn(f"Export option: {config.optimization.export_mode} not found. Defaulting to no model export") 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - GPU available: False, used: False 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - TPU available: False, using: 0 TPU cores 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - IPU available: False, using: 0 IPUs 2024-03-15 13:18:04,978 - pytorch_lightning.utilities.rank_zero - INFO - HPU available: False, using: 0 HPUs 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -
Trainer(limit_train_batches=1.0)was configured so 100% of the batches pe r epoch will be used.. 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -
Trainer(limit_val_batches=1.0)was configured so 100% of the batches will be used.. 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -
Trainer(limit_test_batches=1.0)was configured so 100% of the batches wil l be used.. 2024-03-15 13:18:04,979 - pytorch_lightning.utilities.rank_zero - INFO -
Trainer(limit_predict_batches=1.0)was configured so 100% of the batches will be used.. 2024-03-15 13:18:04,980 - pytorch_lightning.utilities.rank_zero - INFO -
Trainer(val_check_interval=1.0)was configured so validation will run at the end of the training epoch.. 2024-03-15 13:18:04,980 - anomalib - INFO - Training the model. 2024-03-15 13:18:04,986 - anomalib.data.mvtec - INFO - Found the dataset. Traceback (most recent call last): File "C:\patch\anomalib\tools\train.py", line 86, in <module> train(args) File "C:\patch\anomalib\tools\train.py", line 71, in train trainer.fit(model=model, datamodule=datamodule) File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 608, in fit call._call_and_handle_interrupt( File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\call.py", line 38, in _call_and_handle_interrupt return trainer_fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 650, in _fit_impl self._run(model, ckpt_path=self.ckpt_path) File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1051, in _run self._call_setup_hook() # allow user to setup lightning_module in accelerator environment ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1298, in _call_setup_hook self._call_lightning_datamodule_hook("setup", stage=fn) File "C:\patch\anomalib\.venv\Lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1375, in _call_lightning_datamodule_hook return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\src\anomalib\data\base\datamodule.py", line 111, in setup self._setup(stage) File "C:\patch\anomalib\src\anomalib\data\base\datamodule.py", line 127, in _setup self.train_data.setup() File "C:\patch\anomalib\src\anomalib\data\base\dataset.py", line 162, in setup self._setup() File "C:\patch\anomalib\src\anomalib\data\mvtec.py", line 196, in _setup self.samples = make_mvtec_dataset(self.root_category, split=self.split, extensions=IMG_EXTENSIONS) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\patch\anomalib\src\anomalib\data\mvtec.py", line 151, in make_mvtec_dataset samples.loc[ File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 894, in __setitem__ iloc._setitem_with_indexer(indexer, value, self.name) File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 1902, in _setitem_with_indexer iloc._setitem_with_indexer(indexer, value, self.name) File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 1902, in _setitem_with_indexer self._setitem_with_indexer_split_path(indexer, value, name) self._setitem_with_indexer_split_path(indexer, value, name) File "C:\patch\anomalib\.venv\Lib\site-packages\pandas\core\indexing.py", line 1958, in _setitem_with_indexer_split_path raise ValueError( ValueError: Must have equal len keys and value when setting with an iterable
`dataset:
name: mvtec
format: mydata
path: ./datasets/MVTec
task: segmentation
category: bottle
train_batch_size: 32
eval_batch_size: 32
num_workers: 8
image_size: 256 # dimensions to which images are resized (mandatory)
center_crop: 224 # dimensions to which images are center-cropped after resizing (optional)
normalization: imagenet # data distribution to which the images will be normalized: [none, imagenet]
transform_config:
train: null
eval: null
test_split_mode: from_dir # options: [from_dir, synthetic]
test_split_ratio: 0.2 # fraction of train images held out testing (usage depends on test_split_mode)
val_split_mode: same_as_test # options: [same_as_test, from_test, synthetic]
val_split_ratio: 0.5 # fraction of train/test images held out for validation (usage depends on val_split_mode)
tiling:
apply: false
tile_size: null
stride: null
remove_border_count: 0
use_random_tiling: False
random_tile_count: 16
model:
name: patchcore
backbone: wide_resnet50_2
pre_trained: true
layers:
- layer2
- layer3
coreset_sampling_ratio: 0.1
num_neighbors: 9
normalization_method: min_max # options: [null, min_max, cdf]
metrics:
image:
- F1Score
- AUROC
pixel:
- F1Score
- AUROC
threshold:
method: adaptive #options: [adaptive, manual]
manual_image: null
manual_pixel: null
visualization:
show_images: False # show images on the screen
save_images: True # save images to the file system
log_images: True # log images to the available loggers (if any)
image_save_path: null # path to which images will be saved
mode: full # options: ["full", "simple"]
project:
seed: 0
path: ./results
logging:
logger: [] # options: [comet, tensorboard, wandb, csv] or combinations.
log_graph: false # Logs the model graph to respective logger.
optimization:
export_mode: null # options: onnx, openvino
PL Trainer Args. Don't add extra parameter here.
trainer:
enable_checkpointing: true
default_root_dir: null
gradient_clip_val: 0
gradient_clip_algorithm: norm
num_nodes: 1
devices: 1
enable_progress_bar: true
overfit_batches: 0.0
track_grad_norm: -1
check_val_every_n_epoch: 1 # Don't validate before extracting features.
fast_dev_run: false
accumulate_grad_batches: 1
max_epochs: 1
min_epochs: null
max_steps: -1
min_steps: null
max_time: null
limit_train_batches: 1.0
limit_val_batches: 1.0
limit_test_batches: 1.0
limit_predict_batches: 1.0
val_check_interval: 1.0 # Don't validate before extracting features.
log_every_n_steps: 50
accelerator: auto # <"cpu", "gpu", "tpu", "ipu", "hpu", "auto">
strategy: null
sync_batchnorm: false
precision: 32
enable_model_summary: true
num_sanity_val_steps: 0
profiler: null
benchmark: false
deterministic: false
reload_dataloaders_every_n_epochs: 0
auto_lr_find: false
replace_sampler_ddp: true
detect_anomaly: false
auto_scale_batch_size: false
plugins: null
move_metrics_to_cpu: false
multiple_trainloader_mode: max_size_cycle
`
Beta Was this translation helpful? Give feedback.
All reactions