{"id":23777,"library":"gandlf","title":"GaNDLF","description":"A generalizable AI framework for segmentation, regression, and classification in medical imaging, built on PyTorch. Current version 0.1.5, with releases on PyPI monthly. Supports multiple architectures and modalities.","status":"active","version":"0.1.5","language":"python","source_language":"en","source_url":"https://github.com/CBICA/GaNDLF","tags":["medical-imaging","deep-learning","pytorch","segmentation","classification"],"install":[{"cmd":"pip install gandlf","lang":"bash","label":"Latest stable release"}],"dependencies":[{"reason":"Core deep learning framework","package":"torch","optional":false},{"reason":"Medical imaging utilities and transformations","package":"monai","optional":false},{"reason":"Reading/writing NIfTI medical images","package":"nibabel","optional":false}],"imports":[{"note":"Correct import for the main class","wrong":"","symbol":"GANDLF","correct":"from gandlf import GANDLF"},{"note":"Common mistake: TrainingManager is in submodule","wrong":"from gandlf import TrainingManager","symbol":"TrainingManager","correct":"from gandlf.training_manager import TrainingManager"},{"note":"Incorrect flat import; must use submodule","wrong":"from gandlf import InferenceManager","symbol":"InferenceManager","correct":"from gandlf.inference_manager import InferenceManager"}],"quickstart":{"code":"from gandlf import GANDLF\nimport os\n\ngandlf_instance = GANDLF(\n    config_path='path/to/config.yaml',\n    data_path='path/to/data/'\n)\ngandlf_instance.train()\n# For inference:\n# gandlf_instance.infer(input='path/to/test.nii.gz')","lang":"python","description":"Basic training with GaNDLF using a YAML config file. Replace paths as needed."},"warnings":[{"fix":"Use Python 3.10, 3.11, or 3.12.","message":"Python version must be >3.9 and <3.13. Installing with Python 3.13+ will fail.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Use full submodule path (e.g., 'from gandlf.training_manager import TrainingManager').","message":"Importing from gandlf directly (e.g., 'from gandlf import TrainingManager') is deprecated after v0.1.0.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Use os.path.abspath() or absolute paths in YAML.","message":"The config file must have absolute paths for data directories; relative paths may cause file-not-found errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Run 'pip install torch monai' before installing gandlf.","message":"GaNDLF requires MONAI and PyTorch to be installed separately; pip does not automatically install them.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install gandlf' in the correct Python environment.","cause":"GaNDLF not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'gandlf'"},{"fix":"Use 'from gandlf.training_manager import TrainingManager'.","cause":"Incorrect import path; TrainingManager is in submodule.","error":"ImportError: cannot import name 'TrainingManager' from 'gandlf'"},{"fix":"Install PyTorch with CUDA support: 'pip install torch --index-url https://download.pytorch.org/whl/cu118'.","cause":"Trying to run on GPU without CUDA or with incompatible PyTorch.","error":"RuntimeError: Could not find device. Please check CUDA availability."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}