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

OSError: h94/IP-Adapter does not appear to have a file named models\image_encoder\config.json #30

Open
knuthnads opened this issue Sep 23, 2024 · 2 comments

Comments

@knuthnads
Copy link

knuthnads commented Sep 23, 2024

This is a fresh install.

I tried generating the coarse texture by running:

python pipeline_paint3d_stage1.py --sd_config controlnet/config/depth_based_inpaint_template.yaml --render_config paint3d/config/train_config_paint3d.py --mesh_path demo/objs/Suzanne_monkey/Suzanne_monkey.obj --prompt " " --ip_adapter_image_path demo/objs/Suzanne_monkey/img_prompt.png --outdir outputs/img_stage1

This resulted in the following error:

Traceback (most recent call last):
  File "pipeline_paint3d_stage1.py", line 287, in <module>
    main()
  File "pipeline_paint3d_stage1.py", line 195, in main
    depth_cnet = txt2imgControlNet(sd_cfg.txt2img)
  File "D:\Projects\Python\Paint3D\controlnet\diffusers_cnet_txt2img.py", line 20, in __init__
    pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter_sd15.safetensors")
  File "D:\anaconda3\envs\paint3d\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\anaconda3\envs\paint3d\lib\site-packages\diffusers\loaders\ip_adapter.py", line 139, in load_ip_adapter
    image_encoder = CLIPVisionModelWithProjection.from_pretrained(
  File "D:\anaconda3\envs\paint3d\lib\site-packages\transformers\modeling_utils.py", line 2175, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
  File "D:\anaconda3\envs\paint3d\lib\site-packages\transformers\models\clip\configuration_clip.py", line 233, in from_pretrained
    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "D:\anaconda3\envs\paint3d\lib\site-packages\transformers\configuration_utils.py", line 573, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "D:\anaconda3\envs\paint3d\lib\site-packages\transformers\configuration_utils.py", line 628, in _get_config_dict
    resolved_config_file = cached_file(
  File "D:\anaconda3\envs\paint3d\lib\site-packages\transformers\utils\hub.py", line 454, in cached_file
    raise EnvironmentError(
OSError: h94/IP-Adapter does not appear to have a file named models\image_encoder\config.json. Checkout 'https://huggingface.co/h94/IP-Adapter/main' for available files.

Is it no longer possible to acquire the files that Paint3D needs to function?

@michisaurio
Copy link

Hi!
I have exactly the same problem, but have not been able to solve it.
The config.json file can be reached at https://huggingface.co/h94/IP-Adapter/tree/main/models/image_encoder. It seems that the "tree" subdirectory is somehow missing. However, I have not figured out how to modify the source code if this is the case. Maybe somebody else can share their solutions.
Best,

@lmc2000
Copy link

lmc2000 commented Dec 16, 2024

由于huggface-hub包有bug,在url拼接时%5C转义字符未能成功转义,可以在file_download.py 修改增加判断
if "%5C" in url:
url=url.replace("%5C","/")

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