Troubleshooting Guide¶
Solutions to common issues when using Veridex.
Installation Issues¶
Problem: pip install veridex fails¶
Symptoms:
Solutions:
-
Update pip:
-
Check Python version (requires 3.9+):
-
Try with specific index:
Problem: Dependency conflicts¶
Symptoms:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed
Solutions:
-
Use a fresh virtual environment:
-
Install with --no-deps and then dependencies:
-
Use conda environment:
Import Errors¶
Problem: "No module named 'transformers'"¶
Symptoms:
Solution:
Install the appropriate extras:
# For text detectors
pip install veridex[text]
# For all modalities
pip install veridex[text,image,audio]
Verification:
Problem: "No module named 'librosa'"¶
Symptoms:
Solution:
Install audio dependencies:
Problem: "No module named 'PIL'" or "No module named 'cv2'"¶
Solution:
Install image dependencies:
Model Download Issues¶
Problem: Model download is very slow¶
Symptoms: - First run takes 10+ minutes - Downloads seem stuck
Solutions:
-
Check your internet connection
-
Set custom cache directory (if disk space limited):
-
Use a mirror (in some regions):
-
Pre-download models:
Problem: "HTTPError: 404 Client Error"¶
Symptoms:
Solution:
This usually means the model name is incorrect or you're offline.
- Check model name in detector initialization
- Verify internet connection
- Try with explicit model_id:
Runtime Errors¶
Problem: "CUDA out of memory"¶
Symptoms:
Solutions:
-
Force CPU usage:
-
Clear GPU cache:
-
Use smaller model:
-
Process in smaller batches
Problem: "TypeError: run() missing required argument"¶
Symptoms:
Solution:
Make sure you're calling run() with the input data:
# ❌ Wrong
detector = PerplexitySignal()
result = detector.run() # Missing input!
# ✓ Correct
detector = PerplexitySignal()
result = detector.run("Your text here") # Provide input
Problem: "ValueError: Text too short"¶
Symptoms:
Solution:
Provide longer text (at least 10 words):
# ❌ Too short
result = detector.run("Hi")
# ✓ Better
result = detector.run("This is a longer text that provides enough context for analysis.")
Problem: Audio file not loading¶
Symptoms:
Solutions:
-
Check file format (WAV, MP3, FLAC supported):
-
Install ffmpeg (for MP3 support):
-
Convert to WAV:
Problem: Image file not loading¶
Symptoms:
Solutions:
-
Verify image format:
-
Convert image format:
-
Check file path - use absolute paths:
Performance Issues¶
Problem: Detection is very slow¶
Symptoms: - Takes minutes to process - CPU usage at 100%
Solutions:
-
Use GPU if available:
-
Use faster detectors:
-
Batch processing (for multiple files):
Problem: High memory usage¶
Symptoms: - Python process using >4GB RAM - System becoming slow
Solutions:
-
Clear model cache after processing:
-
Process files one at a time:
Platform-Specific Issues¶
macOS: "library not loaded" error¶
Symptoms:
Solution:
Install libsndfile:
Windows: "DLL load failed"¶
Symptoms:
Solutions:
- Install Visual C++ Redistributable:
-
Download from Microsoft
-
Reinstall Pillow:
Linux: Missing system libraries¶
Symptoms:
Solution:
Install system dependencies:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y \
libsndfile1 \
ffmpeg \
libavcodec-extra \
python3-dev
# CentOS/RHEL
sudo yum install -y libsndfile ffmpeg python3-devel
Results Interpretation Issues¶
Problem: Confidence is always low¶
Symptoms:
- result.confidence < 0.5 for all inputs
Explanation:
Low confidence means the detector is genuinely uncertain. This can happen when: - Input is ambiguous - Input is at the boundary between AI/human - Detector is not well-suited for this type of content
Solutions:
- Try a different detector
- Use ensemble approach (multiple detectors)
- Check input quality (is text too short? Image too small?)
Problem: Inconsistent results¶
Symptoms: - Same input gives different scores on different runs
Explanation:
Some detectors have non-deterministic components (e.g., model inference with dropout).
Solution:
Set random seed for reproducibility:
import torch
import numpy as np
import random
def set_seed(seed=42):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
if torch.cuda.is_available():
torch.cuda.manual_seed_all(seed)
set_seed(42)
result = detector.run(input_data)
Getting More Help¶
If your issue isn't covered here:
- Check the FAQ
- Search GitHub Issues
- Ask in GitHub Discussions
- Open a new issue with:
- Veridex version:
pip show veridex - Python version:
python --version - OS:
uname -a(Linux/macOS) orver(Windows) - Full error message and traceback
- Minimal code to reproduce
Useful Debugging Commands¶
# Check installed version
pip show veridex
# List all dependencies
pip list | grep -E "veridex|transformers|torch|librosa|PIL"
# Check Python version
python --version
# Check CUDA availability
python -c "import torch; print(f'CUDA: {torch.cuda.is_available()}')"
# Test basic import
python -c "from veridex.core import BaseSignal; print('OK')"
# Check disk space for model cache
df -h $HOME/.cache/huggingface