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 fused_layer_norm_cuda.cpython-38-x86_64-linux-gnu.so: #4

Open
FrancescoSaverioZuppichini opened this issue Nov 22, 2022 · 1 comment

Comments

@FrancescoSaverioZuppichini

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 :)

@xingqian2018
Copy link
Member

@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.

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

2 participants