An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
I got this error all of a sudden while training. I checked through shape and it was image = torch.size ([1, 3, 256, 256]) mask = torch.size ([1, 256, 256]) and I couldn't get this error, but I got this problem. What should I do to solve it?
On a side note, please make it so that even beginners can follow the guidelines. I don't get it.
Dataset
MVTec
Model
PatchCore
Steps to reproduce the behavior
.
OS information
OS information:
OS: [e.g. Windows11 Pro]
Python version: [e.g. 3.10.14]
Anomalib version: [e.g. 1.2.0]
PyTorch version: [e.g. 2.3.1]
CUDA/cuDNN version: [e.g. 12.1]
GPU models and configuration: [e.g. GeForce RTX 3060]
Expected behavior
I want to train this datasests
Screenshots
"""python
from pathlib import Path
from anomalib.data.utils import read_image
from anomalib.deploy import OpenVINOInferencer
from anomalib.data import MVTec
from anomalib.engine import Engine
from anomalib.models import Patchcore
from anomalib import TaskType
from lightning.pytorch import Trainer
from typing import Any
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
from torchvision.transforms import ToPILImage
from anomalib.deploy import OpenVINOInferencer, ExportType
datamodule = MVTec(num_workers=0,
root=Path("datasets/MVTec"),
category="screw",
image_size=(256, 256),
train_batch_size=1,
eval_batch_size=1,
val_split_ratio=0.2)
datamodule.prepare_data() # Downloads the dataset if it's not in the specified root directory
datamodule.setup()
model = Patchcore()
Describe the bug
I got this error all of a sudden while training. I checked through shape and it was image = torch.size ([1, 3, 256, 256]) mask = torch.size ([1, 256, 256]) and I couldn't get this error, but I got this problem. What should I do to solve it? On a side note, please make it so that even beginners can follow the guidelines. I don't get it.
Dataset
MVTec
Model
PatchCore
Steps to reproduce the behavior
.
OS information
OS information:
Expected behavior
I want to train this datasests
Screenshots
"""python from pathlib import Path
from anomalib.data.utils import read_image from anomalib.deploy import OpenVINOInferencer from anomalib.data import MVTec from anomalib.engine import Engine from anomalib.models import Patchcore from anomalib import TaskType from lightning.pytorch import Trainer
from typing import Any
import numpy as np from matplotlib import pyplot as plt from PIL import Image from torchvision.transforms import ToPILImage
from anomalib.deploy import OpenVINOInferencer, ExportType
datamodule = MVTec(num_workers=0, root=Path("datasets/MVTec"), category="screw", image_size=(256, 256), train_batch_size=1, eval_batch_size=1, val_split_ratio=0.2) datamodule.prepare_data() # Downloads the dataset if it's not in the specified
root
directory datamodule.setup() model = Patchcore()engine = Trainer( accelerator="gpu", max_epochs=100, min_epochs=10, num_sanity_val_steps=-1, enable_checkpointing=True, val_check_interval=1.0, check_val_every_n_epoch=1 )
engine.fit(model=model, datamodule=datamodule) """
Pip/GitHub
GitHub
What version/branch did you use?
No response
Configuration YAML
Logs
Code of Conduct