SaILaIDiN / Spine-Detection-with-CNNs

3 stars 3 forks source link

Installation doesn't work with PyTorch 2.x and CUDA 12.x #5

Open TNodeCode opened 8 months ago

TNodeCode commented 8 months ago

The current installation script provided in this repository doesn't work anymore with PyTorch 2.x and CUDA 12.x. The problem is that the mmcv-full library in the PyPi repository wasn't compiled for CUDA 12 / PyTorch 2.x. You can fix this by uncommenting the line mim install opencv-full in the file install_requirements.sh and downloading the source code of mmcv-full from this repository: https://github.com/open-mmlab/mmcv Switch to the 1.x branch, otherwise you would install mmcv 2.x. Then run the command FORCE_CUDA=1 MMCV_WITH_OPS=1 pip install -e . -v from the mmcv directory. If you want to install this library on a cluster using Slurm make sure to create a bash script for the installation process that can then be executed via sbatch.

randcraw commented 6 months ago

Because it's hard to find, I thought I'd mention the code for the 1.6 version of MMCV-full is here: https://github.com/open-mmlab/mmcv/releases?page=2 https://github.com/open-mmlab/mmcv/tree/v1.6.0

Once this was built, the installation of the spine detection code was effortless.