tomorrow1238 / Ultraman

37 stars 0 forks source link

There is no ControlNet project under the model, and the transformers version (4.36.2) in your environment conflicts with the 4.24.0 version in ControlNet. #4

Open Reannvin opened 3 months ago

Reannvin commented 3 months ago

There is no ControlNet project under the model, and the transformers version (4.36.2) in your environment conflicts with the 4.24.0 version in ControlNet.

After I manually added the ControlNet project under the model, the following error occurred.

Traceback (most recent call last): File "/data/user/code/Ultraman/scripts/generate_texture.py", line 40, in <module> from lib.diffusion_helper import ( File "/data/user/code/Ultraman/./lib/diffusion_helper.py", line 26, in <module> from models.ControlNet.gradio_depth2image import init_model, process File "/data/user/code/Ultraman/./models/ControlNet/gradio_depth2image.py", line 29, in <module> model.load_state_dict(load_state_dict('./models/ControlNet/models/control_sd15_depth.pth', location='cuda')) File "/data/user/.conda/envs/ultraman/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1604, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for ControlLDM: Unexpected key(s) in state_dict: "cond_stage_model.transformer.text_model.embeddings.position_ids". I found the solution under ControlNet's issue page but does't work for me.

https://github.com/lllyasviel/ControlNet/issues/675

yc4ny commented 2 months ago

@Reannvin I'm also testing the code out and got that error but I've managed to fix it by using pip install transformers==4.29.2

tomorrow1238 commented 2 months ago

There is no ControlNet project under the model, and the transformers version (4.36.2) in your environment conflicts with the 4.24.0 version in ControlNet.

After I manually added the ControlNet project under the model, the following error occurred.

Traceback (most recent call last): File "/data/user/code/Ultraman/scripts/generate_texture.py", line 40, in <module> from lib.diffusion_helper import ( File "/data/user/code/Ultraman/./lib/diffusion_helper.py", line 26, in <module> from models.ControlNet.gradio_depth2image import init_model, process File "/data/user/code/Ultraman/./models/ControlNet/gradio_depth2image.py", line 29, in <module> model.load_state_dict(load_state_dict('./models/ControlNet/models/control_sd15_depth.pth', location='cuda')) File "/data/user/.conda/envs/ultraman/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1604, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for ControlLDM: Unexpected key(s) in state_dict: "cond_stage_model.transformer.text_model.embeddings.position_ids". I found the solution under ControlNet's issue page but does't work for me.

lllyasviel/ControlNet#675

Thank you for supporting our work and asking valuable questions. We are recently optimizing our algorithm to achieve better results. We will update a version of the code when it is done. We will pay attention to the issues you raise.