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
{{ message }}
Repository navigation
❓ <title>I trained using the data from MVTecAD, but the results were not very satisfactory. #3319
My training code:
`from anomalib.data import MVTecAD
from anomalib.engine import Engine
from anomalib.models import Patchcore
from pathlib import Path
from anomalib.data import Folder
Initialize PatchCore model with specific parameters
model = Patchcore(
backbone="wide_resnet50_2", # Feature extraction backbone
layers=["layer2", "layer3"], # Layers to extract features from
pre_trained=True, # Use pretrained weights
coreset_sampling_ratio=0.1,
)
engine = Engine(
max_epochs=1, # Patchcore typically needs only one epoch
accelerator="auto", # Automatically detect GPU/CPU
devices=1, # Number of devices to use
limit_val_batches=0, # Skip validation batches
)
Any reason why you are not using MVTeCAD datamodule over the Folder?
Just looking at your code, I think the issue might be passing this limit_val_batches=0 to the engine.
Can you remove this and try again?
Thank you @rajeshgangireddy ,
Because I don't have a good dataset at present, I used an open-source dataset for testing. After deleting "limit_val_batches=0", I could see the normal results.
Activity
github-actions commentedon Feb 6, 2026
Thanks for submitting this issue! It has been added to our triage queue. A maintainer will review it shortly.
rajeshgangireddy commentedon Feb 9, 2026
Hi @Joe-Zz421,
Any reason why you are not using
MVTeCADdatamodule over theFolder?Just looking at your code, I think the issue might be passing this
limit_val_batches=0to the engine.Can you remove this and try again?
Joe-Zz421 commentedon Feb 9, 2026
Thank you @rajeshgangireddy ,
Because I don't have a good dataset at present, I used an open-source dataset for testing. After deleting "limit_val_batches=0", I could see the normal results.