-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: numpy.core.multiarray failed to import #762
Comments
Sams issue with Python |
I encountered the same issue. Following your method for installation:
Then, using However, when I continue using
Have you encountered such a problem? Thank you for your help! |
Only installs, but sill have runtime errorWhen you run ``` pip install salesforce-lavis==1.0.2 ``` pip will uninstall numpy then install `numpy 2.0.2` for you, just run `pip install numpy==2.1.2` and install 2.1.2 ignoring the dependency error, I tested on my machine and it works (though i think the they need to update the dependencies). My steps is listed here: ``` conda create -n lavis python=3.11 conda activate lavis pip install salesforce-lavis==1.0.2 pip install numpy==2.1.2 conda install opencv ``` and ``` Python 3.11.10 (main, Oct 3 2024, 07:29:13) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from lavis.models import model_zoo /home/hello/anaconda3/envs/lavis/lib/python3.11/site-packages/fairscale/experimental/nn/offload.py:19: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead. return torch.cuda.amp.custom_fwd(orig_func) # type: ignore /home/hello/anaconda3/envs/lavis/lib/python3.11/site-packages/fairscale/experimental/nn/offload.py:30: FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., device_type='cuda')` instead. return torch.cuda.amp.custom_bwd(orig_func) # type: ignore >>> ``` |
To resolve version compatibility issues between
|
where mode zoo models can be downloaded? |
You can try to install opencv-python! I solve this problem by doing this |
You can try the following steps to set up your environment:
|
Thanks a lot! I've faced the same problem, and it really works! |
This question has also been troubling me for a long time. The final solution is to follow the latest version of OpenCV Python, as it supports numpy>2.0 |
Maybe it’s a good practice to clear the pip cache to avoid potential conflicts by running before setup a new environmental.
|
I am currently using
salesforce-lavis
to use BLIP-2. I am getting errors regarding incompatibilities between numpy and opencv. Despite multiple warnings, I updated both packages and it worked, thus I am listing this issue for registration purposes.Current environment:
It installs the following versions:
4.5.5.64
2.0.2
Error traceback:
My solution:
The text was updated successfully, but these errors were encountered: