SHI-Labs / Versatile-Diffusion

Versatile Diffusion: Text, Images and Variations All in One Diffusion Model, arXiv 2022 / ICCV 2023

Home Page:https://arxiv.org/abs/2211.08332

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError fused_layer_norm_cuda.cpython-38-x86_64-linux-gnu.so:

FrancescoSaverioZuppichini opened this issue · comments

Hey guys,

Thanks for the amazing work!

I am trying to run versatile diffusion inside a docker container and I got the following error

ImportError: /opt/conda/lib/python3.8/site-packages/fused_layer_norm_cuda.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN8pybind116detail11type_casterIN3c108ArrayRefIlEEvE4loadENS_6handleEb

I am pulling this repo -> https://huggingface.co/spaces/shi-labs/Versatile-Diffusion and building using the following docker file

FROM nvcr.io/nvidia/pytorch:22.10-py3
# ARG HUGGING_FACE_HUB_TOKEN
ENV DEBIAN_FRONTEND noninteractive
# gradio and streamlit default ports
EXPOSE 7860 8501
RUN  apt update && apt install -y git-lfs ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
    && rm -rf /var/lib/apt/lists/*
RUN git lfs install
WORKDIR /home/user
WORKDIR /home/user/app
# we will reinstall pillow using pillow-smid, for better performances
RUN pip uninstall -y pillow \
 && pip install -U --force-reinstall pillow-simd
RUN pip install "protobuf<4" "click<8.1" gradio datasets huggingface_hub ftfy GitPython
# clone user stuff
RUN git clone [{{ repo_url }} .](https://huggingface.co/spaces/shi-labs/Versatile-Diffusion)
RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt; fi;
RUN if [ -f "packages.txt" ]; then apt-get install $(grep -vE "^\s*#" packages.txt  | tr "\n" " "); fi;
# some space had this error 
# https://stackoverflow.com/questions/72706073/attributeerror-partially-initialized-module-cv2-has-no-attribute-gapi-wip-gs
# so we need to downgrade opencv
RUN pip uninstall -y opencv-python \
 && pip install  opencv-python==4.5.5.64 
# if hf token was passed
# run the app once for the initial setup
# RUN if [ "$HUGGING_FACE_HUB_TOKEN" ]; then python app.py; fi
ENTRYPOINT ["python", "app.py"]

This is part of my my-spaces initiatize, to give the community docker images with baked-in ML demos

Any idea?

Thanks :)

@FrancescoSaverioZuppichini Sorry, I am not an active user of Docker, I will check with someone more familiar with it. Meanwhile, see whether other people encounter this issue.