This guide covers common issues when using AnomaVision and how to fix them.
torch not compiled with CUDA enabled)Cause: Installed PyTorch version doesnβt match your CUDA toolkit. Fix: Reinstall PyTorch with the correct CUDA version:
# Example for CUDA 12.1
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Or use Poetry:
poetry install --extras "cu121"
onnxruntime not foundCause: ONNX Runtime not installed. Fix:
pip install onnxruntime-gpu onnxruntime-tools
Cause: Missing Intel OpenVINO dependencies. Fix:
pip install openvino
Check OpenVINO installation guide if errors persist.
FileNotFoundError: train/good not foundCause: Dataset not in MVTec structure. Expected Layout:
dataset/
βββ bottle/
βββ train/good/
βββ test/broken_large/
Fix: Reorganize folders into the correct structure.
Cause: Non-image files (e.g., .txt, .DS_Store) in dataset.
Fix: Remove or filter out invalid files.
Fixes:
resize: [128,128])batch_size--device cuda) if availableCUDA out of memory during trainingFixes:
batch_sizeresnet18 instead of wide_resnet50)RuntimeError: Input size mismatchCause: Model expects a fixed input size.
Fix: Resize input images to the same size used during training (resize / crop_size).
Causes & Fixes:
--threshmean/std as training--class_name or config.ymlUnsupported operator during ONNX exportFixes:
--opset 16)Fixes:
--quantize-dynamic for lightweight INT8fp16Causes & Fixes:
norm_mean & norm_stdviz_alpha too low β increase to 0.7--threshQ: Which backbones are supported?
A: Currently resnet18 and wide_resnet50. More will be added in future.
Q: How to deploy on edge devices without Python?
A: Use the C++ ONNX runtime provided in /docs/cpp/.
Q: Can I train on custom datasets? A: Yes, as long as the dataset follows MVTec-style folder structure.
β With this guide, you should be able to quickly solve most common problems. If an issue persists, please open a GitHub Issue with details.