Open mcarletti opened 1 month ago
Thank you your interest :)
If for some reason, conda
indefinitely hangs for you, I would not recommend removing cudatoolkit=11.1 -c conda-forge
, since it might install pytorch for different CUDA
version. Instead, I would run this:
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
As mentioned in the requirements.txt
(see here), did you install the 4.5.5.64
version of opencv-python
?
First of all, thanks for the hint on Pytorch+CUDA šš¼
I tried creating the enviroment a second time, however the process needs a little help because of the following issues:
The installation of the required modules via requirements.txt
updates Pytorch to 2.4.0+cu121
. To fix this and keep 1.8.0+cu111
, I need to re-run the updated conda command you mentioned, that is after pip
. To me, this issue suggests untracked incompatibilities among the packages.
Regarding opencv-python
, I succesfully installed the correct module via the requirements file, and I confirm the version is the one written in the file, that is 4.5.5.64
. This is the output of pip freeze | grep opencv
:
Error processing line 1 of /home/marco/anaconda3/envs/poco2/lib/python3.8/site-packages/distutils-precedence.pth:
Traceback (most recent call last):
File "/home/marco/anaconda3/envs/poco2/lib/python3.8/site.py", line 177, in addpackage
exec(line)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_distutils_hack'
Remainder of file ignored
opencv-python==4.5.5.64
opencv-python-headless==4.10.0.84
As you can read, there is something weird happening when accessing the environment.
distutils
appears every time I open a Python terminal in this "fixed" environment.Despite the right version of the modules, the error mentioned in my initial message is still there and I'm not able to run your code, even after following your Pytorch+CUDA fix and (1) forcing the version of Pytorch š¤·š¼
As of now, updating Pytorch and CUDA to 2.4.0+cu121
and OpenCV to 4.8.0.74
solved the installation, at least for the demo script.
I had a few problems during the installation steps, specifically:
cv2
module due to version mismatching. This prevents to run the demo.I've solved each issue as following. Hope this helps. Cheers!
ā³ CUDA Toolkit installation hangs indefinitely The command
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
does hang indefinitely.Fix 1 (naive solution) I removed the
cudatoolkit=11.1 -c conda-forge
part to let Pytorch install the requirements by itself.Fix 2 (edit, as suggested here)
Avoid a direct reference to cudatoolkit by using a combined Pytorch+CUDA versioning:
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
š„„ OpenCV broken version
I wasn't able to run the demo, due to a broken
cv2
import. This is the error:Fix
As mentioned in this issue, changing
opencv-python
version toopencv-python==4.8.0.74
fixed the problem.