Related: AGENTS.md · doc/INDEX.md · doc/SPEC.md (versioning policy) · doc/gnn/operations/gnn_troubleshooting.md
This guide helps resolve common issues encountered when working with GeneralizedNotationNotation (GNN).
Error: Missing required section: StateSpaceBlock
Cause: GNN file doesn't contain mandatory sections
Solution:
# Your GNN file must include:
## StateSpaceBlock
s_f0[2,1,type=categorical]
o_m0[3,1,type=categorical]
## Connections
s_f0 > o_m0Error: Invalid variable name: 'state_1'
Cause: Variable names don't follow GNN conventions
Solution: Use GNN naming: s_f0, o_m0, u_c0, π_c0
Error: Matrix A dimensions [3,2] don't match state space [2,3]
Cause: Matrix dimensions incompatible with variable definitions
Solution: Ensure matrix dims match: A_m0[obs_dims, state_dims]
Error: Setup step failed - pipeline halted
Cause: Virtual environment or dependency issues
Solutions:
# Clean reinstall (Step 1 = setup)
rm -rf .venv
uv sync
uv run python src/main.py --only-steps 1 --dev
# Manual dependency check
uv pip list | grep -E "(numpy|scipy|matplotlib)"
# Python version (project requires 3.11+)
python --versionError: Permission denied: output/
Cause: Insufficient write permissions
Solutions:
# Fix permissions
chmod -R 755 output/
# Use different output directory
python src/main.py --output-dir /tmp/gnn_outputError: MemoryError: Unable to allocate array
Cause: Large model exceeds available RAM
Solutions:
- Use
--conservative-memoryflag - Reduce model complexity
- Process models individually:
--target-dir single_model/
Error: ModuleNotFoundError: No module named 'pymdp'
Solutions:
# Install PyMDP using UV (recommended)
uv pip install inferactively-pymdp
# Or install via optional group
uv sync --extra active-inferenceError: Julia not found or RxInfer.jl not installed
Solutions:
# Install Julia
wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.0-linux-x86_64.tar.gz
# Follow Julia installation guide
# Install RxInfer.jl
julia -e 'using Pkg; Pkg.add("RxInfer")'Error: XLA compilation failed
Solutions:
- Update JAX:
uv pip install --upgrade jax jaxlib(oruv sync --extra active-inference) - Use CPU-only mode:
export JAX_PLATFORM_NAME=cpu - Simplify model complexity
Error: Graphviz not found
Solutions:
# Ubuntu/Debian
sudo apt-get install graphviz graphviz-dev
# macOS
brew install graphviz
# Windows
# Download from https://graphviz.org/download/Error: Graph too large to render
Solutions:
- Use
--max-nodes 50to limit graph size - Enable hierarchical layout:
--layout hierarchical - Generate SVG instead of PDF:
--format svg
Error: Invalid API key for OpenAI/Anthropic
Solutions:
# Set environment variables
export OPENAI_API_KEY="your-key-here"
export ANTHROPIC_API_KEY="your-key-here"
# Or use config file
echo "OPENAI_API_KEY=your-key" > .envError: Context length exceeded
Solutions:
- Use smaller model:
--llm-model gpt-3.5-turbo - Process models in chunks:
--chunk-size 1000 - Simplify model before LLM analysis
# Run comprehensive diagnostics
python src/main.py --diagnostics
# Check specific components
python src/5_type_checker.py --validate-only
python src/1_setup.py --check-deps# Enable detailed logging
python src/main.py --debug --target-dir examples/
# Verbose output for specific steps
python src/main.py --only-steps 4 --verbose# System info
python -c "import sys; print(f'Python: {sys.version}')"
pip list | head -20
# GNN-specific info
python -c "import src.gnn as gnn; print(gnn.__version__)"Problem: Pipeline runs slowly Solutions:
- Use
--parallelfor multi-core processing - Skip expensive steps:
--skip 6,11,13 - Use conservative mode:
--conservative
Problem: High memory usage Solutions:
- Process models sequentially:
--sequential - Reduce visualization quality:
--viz-quality low - Clean up intermediate files:
--cleanup
Problem: File doesn't parse correctly Debugging Steps:
- Check file encoding (must be UTF-8)
- Verify all required sections present
- Validate syntax with type checker
- Compare against working examples
Problem: Export fails or produces invalid output Solutions:
- Check export format support:
python src/7_export.py --list-formats - Use alternative format:
--export-format json - Validate output:
--validate-export
Key log locations:
- Main pipeline:
output/logs/pipeline.log - Step-specific:
output/logs/step_XX.log - Error details:
output/logs/errors.log
Include this info when reporting issues:
# Generate debug package
python src/main.py --debug-package
# This creates: output/debug_package_TIMESTAMP.zip
# Contains: logs, system info, example files, config- Check existing GitHub issues
- Search documentation
- Join Active Inference Institute community
- Provide minimal reproducible example
- Start with simple examples
- Validate syntax early and often
- Use version control for model files
- Test across different backends
- Run setup step first
- Check dependencies regularly
- Use appropriate hardware for large models
- Monitor resource usage
- Update dependencies monthly
- Clean output directories regularly
- Backup important model files
- Document custom configurations
# Reset everything
rm -rf output/ src/.venv/
python src/main.py --only-steps 2
# Fix permissions
find . -name "*.py" -exec chmod +x {} \;
# Clean install using UV
uv sync --refresh
# Minimal test
python src/main.py --target-dir input/gnn_files/ --only-steps 1,4If pipeline is completely broken:
# Nuclear option - complete reset
git checkout HEAD -- .
rm -rf output/ src/.venv/ __pycache__/
python src/1_setup.py --clean-installThis troubleshooting guide covers the most common issues. For persistent problems, please file a GitHub issue with debug information.