Error Handling¶
Common errors, solutions, and debugging techniques.
🎯 Overview¶
Learn how to handle and debug common issues.
🐛 Common Errors¶
Model Not Found¶
Error: FileNotFoundError: Model file not found
Solution:
Input Validation Failed¶
Error: Input mismatch. Missing: {'input'}
Solution:
# Check input names
gpux inspect model-name
# Match input names in JSON
{
"correct_input_name": [data]
}
Shape Mismatch¶
Error: Shape mismatch: expected [1,10], got [1,5]
Solution:
Provider Not Available¶
Error: RuntimeError: No execution providers available
Solution:
Out of Memory¶
Error: RuntimeError: CUDA out of memory
Solution:
🔍 Debugging¶
Enable Verbose Logging¶
Check Model Details¶
Test with CPU¶
Validate Configuration¶
python -c "from gpux.config.parser import GPUXConfigParser; GPUXConfigParser().parse_file('gpux.yml')"
🛡️ Exception Handling¶
Python¶
from gpux import GPUXRuntime
try:
runtime = GPUXRuntime("model.onnx")
result = runtime.infer(data)
except FileNotFoundError:
print("Model not found")
except ValueError:
print("Invalid input data")
except RuntimeError as e:
print(f"Runtime error: {e}")
finally:
runtime.cleanup()
💡 Key Takeaways¶
Success
✅ Common errors and solutions ✅ Debugging techniques ✅ Exception handling ✅ Validation methods
Previous: Python API