Open GooseIt opened 1 year ago
Hi @GooseIt ! Can you try instaling opencv 4.5.2 instead of the latest version?
Hi there,
@GooseIt did you manage to solve the issue?
I was able to solve it by installing numba==0.56.2
.
Here is my full environment.yaml file:
name: torch-ffcv
channels:
- pytorch
- nvidia
- conda-forge
dependencies:
- pytorch
- torchvision
- torchaudio
- pytorch-cuda==12.1
- cupy
- pkg-config
- libjpeg-turbo>=2.1.4
- opencv
- numba==0.56.2
- pip
- pip:
- tqdm
- ffcv
@andrewilyas I also tried with opencv==4.5.2
but it did not work. Do you have any clues on what is causing the error ?
Thank you
I am running into this issue today with latest build: ImportError: libopencv_imgproc.so.407: cannot open shared object file: No such file or directory
I am running into this issue as well. Degrading opencv or numba versions did not help solve the issue. Side note: Degrading numba to 0.56.2 also degraded pytorch version to 1.12. Does that happen to you as well @SerezD?
Any suggestions for fix @andrewilyas? Thanks in advance.
Degrading opencv or numba versions did not help solve the issue. Side note: Degrading numba to 0.56.2 also degraded pytorch version to 1.12. Does that happen to you as well @SerezD?
Hi @arnaghosh. No, it does not happen in my case. Note that I install the previously posted environment from conda as:
conda env create -f environment.yaml
using libmamba
for faster solving: https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community
I tried installing the environment on different machines and it always worked for me. Unfortunately, I still have no idea about the cause of the error, so I can't help on that.
Hi @SerezD,
Thank you so much. Can I ask you which pytorch version you are using? I was hoping to use pytorch 2.1.2. Just wondering if the pytorch version conflicts with the numba version.
Hi @SerezD,
Thank you so much. Can I ask you which pytorch version you are using? I was hoping to use pytorch 2.1.2. Just wondering if the pytorch version conflicts with the numba version.
Without further indications in the environment file, it will attempt to install the latest version of pytorch. For example, in one of my local environments it installed pytorch 2.2.0
and numba 0.56.2
.
Thanks again @SerezD.
I tried installing my env from scratch, and this time it did not degrade pytorch (as you predicted). However, importing ffcv still doesn't work, i.e. I still get the same error:
ImportError: libopencv_imgproc.so.407: cannot open shared object file: No such file or directory
Update: The solution proposed by @SerezD worked for me! 🎉 Thanks a lot!
I was using a cached version of ffcv. Using pip install ffcv --no-cache-dir
in worked! :)
These are the steps that worked for me, in case anyone else finds this list helpful:
conda create --prefix <env_location>/<env_name> -y python=3.9 conda conda-libmamba-solver -c conda-forge
conda activate <env_location>/<env_name>
export CONDA_EXE="$(hash -r; which conda)"
conda config --set solver libmamba
conda config --set channel_priority flexible
conda install -y cupy pkg-config compilers libjpeg-turbo opencv pytorch=2.1.2 torchvision=0.16.2 pytorch-cuda=12.1 torchmetrics numba=0.56.2 terminaltables matplotlib scikit-learn pandas assertpy pytz -c pytorch -c nvidia -c conda-forge
pip install ffcv --no-cache-dir
I've installed
ffcv
library and I get the following error on lineimport ffcv
:I've tried running
conda remove opencv && conda install opencv
andpip install -U ffcv
.I've also tried solutions suggested here - https://github.com/libffcv/ffcv/issues/329#issuecomment-1634407591.
Nothing changed. Please help fixing the issue.
It seems there was an issue like mine - https://github.com/libffcv/ffcv/issues/136. However, it was solved by Slack in February 2022, and ffcv Slack server does not hold messages more than 90 days of age. If you know which solution worked there, I'm happy to hear it.