Installation
Prerequisites
DeepLens requires:
- Python 3.12 or later
- PyTorch with CUDA support (recommended for GPU acceleration)
- Conda (optional, but recommended for environment management)
Installation Methods
Quick Installation (Tested on Linux, macOS, and Windows)
Clone the repository:
Create a conda environment:
Install PyTorch and dependencies:
For Linux and macOS:
For Windows:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt
Alternative: Using Conda Environment File
Clone the repository:
Create a conda environment using the provided environment file:
Verify Installation
To verify that DeepLens is installed correctly, run the demo script:
If the installation is successful, you should see lens visualization and simulation outputs.
GPU Support
For optimal performance, DeepLens requires a CUDA-capable GPU. To check if PyTorch can detect your GPU:
If this returns False, you may need to reinstall PyTorch with CUDA support. Visit the PyTorch installation page for instructions.
Additional Dependencies
Some advanced features may require additional packages:
- Matplotlib: For visualization (usually included in requirements.txt)
- OpenCV: For image processing operations
- Pillow: For image I/O operations
These are typically installed automatically with the standard installation methods.
Troubleshooting
Common Issues
Import Errors
If you encounter import errors, ensure that:
- The conda/virtual environment is activated
- All dependencies are installed correctly
- You're running Python from the DeepLens root directory
CUDA/GPU Issues
If you have GPU issues:
- Check that your NVIDIA drivers are up to date
- Verify that PyTorch is installed with the correct CUDA version
- Try running with CPU first to isolate the issue
For more help, join our Slack workspace or contact the developers.