This guide covers common issues when using AnomaVision and how to fix them.
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/cu121Or use Poetry:
poetry install --extras "cu121"Cause: ONNX Runtime not installed. Fix:
pip install onnxruntime-gpu onnxruntime-toolsCause: Missing Intel OpenVINO dependencies. Fix:
pip install openvinoCheck OpenVINO installation guide if errors persist.
Cause: 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:
- Use smaller image size (
resize: [128,128]) - Reduce
batch_size - Switch to GPU (
--device cuda) if available
Fixes:
- Reduce
batch_size - Use smaller backbone (
resnet18instead ofwide_resnet50) - Enable memory-efficient mode (where supported)
Cause: Model expects a fixed input size.
Fix: Resize input images to the same size used during training (resize / crop_size).
Causes & Fixes:
- Threshold too high → lower
--thresh - Wrong normalization → ensure dataset uses same
mean/stdas training - Wrong class name → check
--class_nameorconfig.yml
Fixes:
- Upgrade to latest PyTorch and ONNX
- Try lower opset (e.g.,
--opset 16) - If still failing → use TorchScript export
Fixes:
- Use
--quantize-dynamicfor lightweight INT8 - If accuracy drops, stick to
fp16
Causes & Fixes:
- Wrong normalization → check
norm_mean&norm_std viz_alphatoo low → increase to0.7- Threshold too high → lower
--thresh
Q: 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.