Git Product home page Git Product logo

Comments (6)

slicksammy avatar slicksammy commented on June 1, 2024 1

I'm also trying to build a docker image. I've tried a couple of base images, including pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime which i found here and I always get some dependency error with RUN pip install -r requirements/pt2.txt and they look something like ERROR: No matching distribution found for black==23.7.0 This is my Dockerfile

FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime
WORKDIR /app
RUN apt update && apt install -y git
RUN git clone https://github.com/Stability-AI/generative-models.git
WORKDIR /app/generative-models
RUN pip install -r requirements/pt2.txt
RUN pip install .

Edit: this worked for me (not sure about inferencing but I was able to build the app):

FROM pytorch/pytorch:latest
WORKDIR /app
RUN apt update && apt install -y git
RUN git clone https://github.com/Stability-AI/generative-models.git
WORKDIR /app/generative-models
RUN pip install -r requirements/pt2.txt
RUN pip install .

from generative-models.

loretoparisi avatar loretoparisi commented on June 1, 2024 1

I have added a Dockerfile with cuda 11.8, xformers, torch 2.0.1 and all required dependencies here

https://github.com/loretoparisi/generative-models

from generative-models.

jenuk avatar jenuk commented on June 1, 2024

Hi, you seem to be running into a problem with the opencv python package. It seems most likely that you have some missing dependencies (see here, maybe you can run sudo apt install ffmpeg libsm6 libtext6) or some issue from streamlit (see here, run sudo apt install libgl1 in that case). Try running python -c "import cv2", if that fails, it's the first issue, if that runs through it is caused by streamlit. (Both of these fixes expect that you are running ubuntu)

if this doesn't help, try searching specifically for "opencv python" + your operating system & version.

from generative-models.

bitsnaps avatar bitsnaps commented on June 1, 2024

Still having the same issue, we might be dealing with a deeper issue related to the Docker container's ability to access the graphics hardware, access the GPU (required by OpenCV for some operations) can be tricky because of the container isolation to host OS, even the Nvidia's Docker images didn't work (maybe due to the limitation of graphics ability), I think this has to be run outside of containers. How do you run this?

from generative-models.

jenuk avatar jenuk commented on June 1, 2024

See here for installation instructions. I know that someone manged to make it work in docker, but for your nvidia/docker issues I recommend opening an issue with one of them.

from generative-models.

loretoparisi avatar loretoparisi commented on June 1, 2024

See here for installation instructions. I know that someone manged to make it work in docker, but for your nvidia/docker issues I recommend opening an issue with one of them.

I confirm I'm having the same issue in Docker

root@4ff0cee5b260:/opt/program# python scripts/demo/detect.py assets/test_image.png 
Traceback (most recent call last):
  File "/opt/program/scripts/demo/detect.py", line 3, in <module>
    import cv2
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
root@4ff0cee5b260:/opt/program# 

In My docker file I have

FROM pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.0-cuda11.8.0

# ...

COPY requirements/pt2.txt /opt/program/requirements.txt
# install requirements in order
RUN pip3 install -r /opt/program/requirements.txt

from generative-models.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.