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

CodeFormer/PyTorch issue #9

Open
dlasher opened this issue Nov 1, 2022 · 3 comments
Open

CodeFormer/PyTorch issue #9

dlasher opened this issue Nov 1, 2022 · 3 comments

Comments

@dlasher
Copy link

dlasher commented Nov 1, 2022

Docker on Ubuntu 22LTS - AMD 6900XT GPU

Fresh pull today, fails to start, complaining about setting up CodeFormer. tore down, re-pulled from scratch, same error:

Error setting up CodeFormer:
Traceback (most recent call last):
  File "/sd/modules/codeformer_model.py", line 38, in setup_model
    from facelib.utils.face_restoration_helper import FaceRestoreHelper
  File "/sd/repositories/CodeFormer/facelib/utils/face_restoration_helper.py", line 7, in <module>
    from facelib.detection import init_detection_model
  File "/sd/repositories/CodeFormer/facelib/detection/__init__.py", line 11, in <module>
    from .yolov5face.face_detector import YoloDetector
  File "/sd/repositories/CodeFormer/facelib/detection/yolov5face/face_detector.py", line 20, in <module>
    IS_HIGH_VERSION = tuple(map(int, torch.__version__.split('+')[0].split('.'))) >= (1, 9, 0)
ValueError: invalid literal for int() with base 10: '0a0'

WARNING:root:Pytorch pre-release version 1.13.0a0+gitd566718 - assuming intent to test it
Traceback (most recent call last):
  File "launch.py", line 169, in <module>
    start_webui()
  File "launch.py", line 164, in start_webui
    webui.webui()
  File "/sd/webui.py", line 92, in webui
    initialize()
  File "/sd/webui.py", line 85, in initialize
    shared.sd_model = modules.sd_models.load_model()
  File "/sd/modules/sd_models.py", line 181, in load_model
    sd_model = instantiate_from_config(sd_config.model)
  File "/sd/repositories/stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/sd/repositories/stable-diffusion/ldm/util.py", line 93, in get_obj_from_str
    return getattr(importlib.import_module(module, package=None), cls)
  File "/opt/conda/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/sd/repositories/stable-diffusion/ldm/models/diffusion/ddpm.py", line 19, in <module>
    from pytorch_lightning.utilities.distributed import rank_zero_only
ImportError: cannot import name 'rank_zero_only' from 'pytorch_lightning.utilities.distributed' (/opt/conda/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py)
@dlasher
Copy link
Author

dlasher commented Nov 1, 2022

Just to confirm - fresh Ubuntu 22 install on empty drive, installed docker, and pulled [stable-diffusion-rocm-docker] - errors out the same way. Something new is broken in the last 2 weeks (since I set this up the last time)

@Fecfec97
Copy link

Fecfec97 commented Nov 2, 2022

To add, I am also experiencing this error on Manjaro. I haven't had this git working as of yet as I have only tried to install it today.

I have managed to get past this point with a standard installation before.

Edit:

Interestingly I have managed to get it to launch using the command:

drun --name sd l1naforever/stable-diffusion-rocm:baked

Though it still carries the same error, and wont actually produce anything, even though the webui is working

Unable to find image 'l1naforever/stable-diffusion-rocm:baked' locally
baked: Pulling from l1naforever/stable-diffusion-rocm
3b65ec22a9e9: Already exists
672c6966ed08: Already exists
c6ff2848b7a2: Already exists
16b13c05c444: Already exists
c6eddca520ee: Already exists
f1b9a9cad1c7: Already exists
aa964431ec1f: Already exists
19f05ac8f4fd: Already exists
1bb04df460f1: Already exists
a00eb1dc88fa: Already exists
c65f0f6e3621: Already exists
4a0073e28e75: Already exists
51db81038349: Already exists
8b30faa6eea7: Already exists
ec9a5f407a44: Already exists
b74e875ede84: Already exists
62dc6a9ee118: Already exists
dc832aafeaf6: Already exists
e279ebfd5e92: Already exists
f8802f99fcf9: Already exists
5dc3d6baee95: Already exists
0a74aad6f260: Already exists
18ac3259995c: Already exists
329ba27edb65: Already exists
ff4708d15eb2: Already exists
65e97f4feb3a: Already exists
5044019df697: Already exists
fab2692dec7a: Already exists
2996f6ef999f: Already exists
a6ec0f016a81: Already exists
50a6bf13e1d5: Already exists
9c40611e59c9: Already exists
fedc0c0800e1: Already exists
02441ba6f3a1: Already exists
d18712e2f093: Already exists
ffe880ee0557: Already exists
0cf564656846: Already exists
10b6cdb90d0f: Pull complete
Digest: sha256:2ecd15a4e445cc95d511853d387ddb5ca4c4ae09c2a20643e8ab0f827cec71fe
Status: Downloaded newer image for l1naforever/stable-diffusion-rocm:baked
Python 3.7.13 (default, Mar 29 2022, 02:18:16)
[GCC 7.5.0]
Commit hash: 08b3f7aef15f74f4d2254b1274dd66fcc7940348
Installing requirements for Web UI
Launching Web UI with arguments: --precision full --no-half
Error setting up CodeFormer:
Traceback (most recent call last):
File "/sd/modules/codeformer_model.py", line 38, in setup_model
from facelib.utils.face_restoration_helper import FaceRestoreHelper
File "/sd/repositories/CodeFormer/facelib/utils/face_restoration_helper.py", line 7, in
from facelib.detection import init_detection_model
File "/sd/repositories/CodeFormer/facelib/detection/init.py", line 11, in
from .yolov5face.face_detector import YoloDetector
File "/sd/repositories/CodeFormer/facelib/detection/yolov5face/face_detector.py", line 20, in
IS_HIGH_VERSION = tuple(map(int, torch.version.split('+')[0].split('.'))) >= (1, 9, 0)
ValueError: invalid literal for int() with base 10: '0a0'

WARNING:root:Pytorch pre-release version 1.13.0a0+gitd566718 - assuming intent to test it
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Loading weights [7460a6fa] from /sd/models/Stable-diffusion/model.ckpt
Global Step: 470000
Applying cross attention optimization (Doggettx).
Model loaded.
Loaded a total of 0 textual inversion embeddings.
Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().`

@FinnRG
Copy link

FinnRG commented Dec 26, 2022

The specific error was fixed in sczhou/CodeFormer@8e5f81b, but I couldn't find the reason why this container still pulls the old version

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

3 participants