Closed Dintan closed 3 months ago
add this to the end of run
in cog.yaml
- sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py
Thanks, that worked
add this to the end of
run
incog.yaml
- sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py
This fix doesn't seem to work anymore. I'm getting the following error trying to run it locally with cog
------
> [stage-0 12/14] RUN sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py:
0.681 sed: can't read /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py: No such file or directory
------
Dockerfile:13
--------------------
11 | RUN git clone https://github.com/philz1337x/stable-diffusion-webui-cog-init /stable-diffusion-webui
12 | RUN python /stable-diffusion-webui/init_env.py --skip-torch-cuda-test
13 | >>> RUN sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py
14 | WORKDIR /src
15 | EXPOSE 5000
--------------------
ERROR: failed to solve: process "/bin/sh -c sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py" did not complete successfully: exit code: 2
ⅹ Failed to build Docker image: exit status 1
Changing the 3.10.4 to 3.10.14 fixed it in my case. Though I don't see why it uses 3.10.14 when the cog.yaml should use 3.10.4.
When I try to run it on cog I'm constantly getting this error and am unable to go beyond there: Starting Docker image cog-clarity-upscaler-main-base and running setup()... import_hook.py tried to disable xformers, but it was not requested. Ignoring Traceback (most recent call last): File "/root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/cog/server/worker.py", line 189, in _setup run_setup(self._predictor) File "/root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/cog/predictor.py", line 84, in run_setup predictor.setup() File "/src/predict.py", line 37, in setup initialize.imports() File "/src/modules/initialize.py", line 37, in imports from modules import processing, gradio_extensons, ui # noqa: F401 File "/src/modules/processing.py", line 18, in
import modules.sd_hijack
File "/src/modules/sd_hijack.py", line 5, in
from modules import devices, sd_hijack_optimizations, shared, script_callbacks, errors, sd_unet, patches
File "/src/modules/sd_hijack_optimizations.py", line 13, in
from modules.hypernetworks import hypernetwork
File "/src/modules/hypernetworks/hypernetwork.py", line 13, in
from modules import devices, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint, errors
File "/src/modules/sd_samplers.py", line 1, in
from modules import sd_samplers_kdiffusion, sd_samplers_timesteps, shared
File "/src/modules/sd_samplers_kdiffusion.py", line 3, in
import k_diffusion.sampling
File "/src/repositories/k-diffusion/k_diffusion/init.py", line 1, in
from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils
File "/src/repositories/k-diffusion/k_diffusion/evaluation.py", line 6, in
import clip
File "/root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/init.py", line 1, in
from .clip import *
File "/root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py", line 6, in
from pkg_resources import packaging
ImportError: cannot import name 'packaging' from 'pkg_resources' (/root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/pkg_resources/init.py)?