Skip to content
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 when trying to use salesforce-lavis in Huggingface app #767

Open
jchwenger opened this issue Nov 16, 2024 · 0 comments

Comments

@jchwenger
Copy link

Hi, I'm trying to repair the dependencies for this Huggingface app.

When I perform conda env create -n pix2pix-zero -f environment.yaml, or try and install things manually through pip, I encounter this error, and so far my attempts have not been successful at resolving it. Any chance someone here would know what would be the right dependencies to choose?

Traceback (most recent call last):
  File "/home/quine/Documents/pix2pix-zero-demo/app.py", line 8, in <module>
    from utils.generate_synthetic import *
  File "/home/quine/Documents/pix2pix-zero-demo/utils/generate_synthetic.py", line 18, in <module>
    from lavis.models import load_model_and_preprocess
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/lavis/__init__.py", line 15, in <module>
    from lavis.datasets.builders import *
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/lavis/datasets/builders/__init__.py", line 8, in <module>
    from lavis.datasets.builders.base_dataset_builder import load_dataset_config
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/lavis/datasets/builders/base_dataset_builder.py", line 18, in <module>
    from lavis.processors.base_processor import BaseProcessor
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/lavis/processors/__init__.py", line 10, in <module>
    from lavis.processors.alpro_processors import (
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/lavis/processors/alpro_processors.py", line 13, in <module>
    from lavis.processors.randaugment import VideoRandomAugment
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/lavis/processors/randaugment.py", line 8, in <module>
    import cv2
  File "/home/quine/anaconda3/envs/pix2pix-zero/lib/python3.10/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

environment.yaml:

name: pix2pix-zero
channels:
  - pytorch
  - nvidia
  - defaults
dependencies:
  - pip
  - pytorch-cuda=11.6
  - torchvision
  - pytorch
  - pip:
    - accelerate
    - diffusers
    - einops
    - gradio
    - ipython
    - numpy
    - opencv-python-headless
    - pillow
    - psutil
    - tqdm
    - transformers
    - salesforce-lavis

requirements.txt:

joblib
accelerate
diffusers==0.12.1
salesforce-lavis
openai

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant