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
For Padim, PatchCore and Reverse Distillation, the tiling doesn't work at the moment.
This happens as the input_tensor is used to tell the shape of anomaly map:
from anomalib.data import MVTec
from anomalib.engine import Engine
from anomalib.models import Padim
from anomalib.callbacks import TilerConfigurationCallback
# Initialize the datamodule and model
datamodule = MVTec(num_workers=0, image_size=(128, 128))
model = Padim()
# prepare tiling configuration callback
tiler_config_callback = TilerConfigurationCallback(enable=True, tile_size=[128, 64], stride=64)
# pass the tiling configuration callback to engine
engine = Engine(image_metrics=["AUROC"], pixel_metrics=["AUROC"], callbacks=[tiler_config_callback])
# train the model (tiling is seamlessly utilized in the background)
engine.fit(datamodule=datamodule, model=model)
OS information
OS information:
OS: Windows 10
Python version: 3.10
Anomalib version: 1.1.0dev
PyTorch version: 2.1
GPU models and configuration: gtx 1060
Expected behavior
The procedure works even with tiler present
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
No response
Configuration YAML
/
Logs
RuntimeError: Predictions and targets are expected to have the same shape, but got torch.Size([262144]) and torch.Size([524288]).
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
For Padim, PatchCore and Reverse Distillation, the tiling doesn't work at the moment.
This happens as the
input_tensor
is used to tell the shape of anomaly map:anomalib/src/anomalib/models/image/padim/torch_model.py
Lines 141 to 148 in 09cbade
but
input_tensor
is overwriten in case of tiler:anomalib/src/anomalib/models/image/padim/torch_model.py
Lines 129 to 130 in 09cbade
which leads to shape mismatch.
Dataset
MVTec
Model
Other (please specify in the field below)
Steps to reproduce the behavior
OS information
OS information:
Expected behavior
The procedure works even with tiler present
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
No response
Configuration YAML
/
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: