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

报错:在checkpoint的ootd文件夹中缺少config.json文件,但是项目仓库里没有相应的文件可下载 #212

Closed
2681248863 opened this issue Sep 20, 2024 · 20 comments

Comments

@2681248863
Copy link

Traceback (most recent call last):
File "/home/srp/ootd/OOTDiffusion/run/gradio_ootd.py", line 22, in
ootd_model_hd = OOTDiffusionHD(0)
File "/home/srp/ootd/OOTDiffusion/ootd/inference_ootd_hd.py", line 37, in init
vae = AutoencoderKL.from_pretrained(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 712, in from_pretrained
config, unused_kwargs, commit_hash = cls.load_config(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 365, in load_config
raise EnvironmentError(
OSError: Error no file named config.json found in directory ../checkpoints/ootd.
报错说我在ootd文件夹里少了个config.json,但是我在这个项目的仓库里没看到这个文件可供下载

@nitinmukesh
Copy link

nitinmukesh commented Sep 20, 2024

I am getting the same error. Did you find solution.

(venv) C:\ai\OOTDiffusion>python run/gradio_ootd.py
Traceback (most recent call last):
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\diffusers\configuration_utils.py", line 371, in load_config
    config_file = hf_hub_download(
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\huggingface_hub\utils\_deprecation.py", line 101, in inner_f
    return f(*args, **kwargs)
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 154, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../checkpoints/ootd'. Use `repo_type` argument if needed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ai\OOTDiffusion\run\gradio_ootd.py", line 22, in <module>
    ootd_model_hd = OOTDiffusionHD(0)
  File "C:\ai\OOTDiffusion\ootd\inference_ootd_hd.py", line 37, in __init__
    vae = AutoencoderKL.from_pretrained(
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\diffusers\models\modeling_utils.py", line 712, in from_pretrained
    config, unused_kwargs, commit_hash = cls.load_config(
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\diffusers\configuration_utils.py", line 407, in load_config
    raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ../checkpoints/ootd is not the path to a directory containing a config.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.

@nitinmukesh
Copy link

SOLUTION

(venv) C:\ai\OOTDiffusion\run>python gradio_ootd.py

@2681248863
Copy link
Author

I am getting the same error. Did you find solution.

(venv) C:\ai\OOTDiffusion>python run/gradio_ootd.py
Traceback (most recent call last):
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\diffusers\configuration_utils.py", line 371, in load_config
    config_file = hf_hub_download(
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\huggingface_hub\utils\_deprecation.py", line 101, in inner_f
    return f(*args, **kwargs)
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 154, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../checkpoints/ootd'. Use `repo_type` argument if needed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ai\OOTDiffusion\run\gradio_ootd.py", line 22, in <module>
    ootd_model_hd = OOTDiffusionHD(0)
  File "C:\ai\OOTDiffusion\ootd\inference_ootd_hd.py", line 37, in __init__
    vae = AutoencoderKL.from_pretrained(
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\diffusers\models\modeling_utils.py", line 712, in from_pretrained
    config, unused_kwargs, commit_hash = cls.load_config(
  File "C:\ai\OOTDiffusion\venv\lib\site-packages\diffusers\configuration_utils.py", line 407, in load_config
    raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ../checkpoints/ootd is not the path to a directory containing a config.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.

我也是和你一样的报错

@2681248863
Copy link
Author

SOLUTION

(venv) C:\ai\OOTDiffusion\run>python gradio_ootd.py

你运行这个文件没有报错吗

@nitinmukesh
Copy link

Yes. Video tutorial for Windows users coning soon.
It will help address all the issues and run successfully.
I have tested on Windows 11 / 8 GB VRAM / 16 GB RAM

@2681248863
Copy link
Author

我运行gradio_ootd.py仍然有相同的报错

@2681248863
Copy link
Author

而且我是在Ubuntu22系统上运行的

@dastan1910
Copy link

I also have this problem and python gradio_ootd.py doesn't help for this case

--sample 4
Traceback (most recent call last):
  File "/home/dastan/.virtualenvs/oot/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 371, in load_config
    config_file = hf_hub_download(
  File "/home/dastan/.virtualenvs/oot/lib/python3.10/site-packages/huggingface_hub/utils/_deprecation.py", line 101, in inner_f
    return f(*args, **kwargs)
  File "/home/dastan/.virtualenvs/oot/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "/home/dastan/.virtualenvs/oot/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 154, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../checkpoints/ootd'. Use `repo_type` argument if needed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dastan/dastan/my_projects/OOTDiffusion/run/gradio_ootd.py", line 22, in <module>
    ootd_model_hd = OOTDiffusionHD(0)
  File "/home/dastan/dastan/my_projects/OOTDiffusion/ootd/inference_ootd_hd.py", line 37, in __init__
    vae = AutoencoderKL.from_pretrained(
  File "/home/dastan/.virtualenvs/oot/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 712, in from_pretrained
    config, unused_kwargs, commit_hash = cls.load_config(
  File "/home/dastan/.virtualenvs/oot/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 407, in load_config
    raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ../checkpoints/ootd is not the path to a directory containing a config.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.

@nitinmukesh
Copy link

@2681248863 @dastan1910

See if this helps
#213

@2681248863
Copy link
Author

@2681248863 @dastan1910

看看这是否有帮助 #213

我按视频进行修改并运行gradio_ootd.py后仍然提示报错:在checkpoint的ootd文件夹里缺少config.json

@nitinmukesh
Copy link

@2681248863

Please paste the complete content of command prompt.

@2681248863
Copy link
Author

@nitinmukesh OSError: Error no file named config.json found in directory ../checkpoints/ootd.

@nitinmukesh
Copy link

nitinmukesh commented Sep 22, 2024

@2681248863

You need to paste the full content, not just error.

Microsoft Windows [Version 10.0.22631.4169]
(c) Microsoft Corporation. All rights reserved.

C:\ai\OOTDiffusion>venv\Scripts\activate

(venv) C:\ai\OOTDiffusion>cd run

(venv) C:\ai\OOTDiffusion\run>python gradio_ootd.py
Loading pipeline components...: 100%|███████████████████████████████████████████████████| 7/7 [00:01<00:00,  6.79it/s]
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["bos_token_id"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["eos_token_id"]` will be overriden.
Loading pipeline components...: 100%|███████████████████████████████████████████████████| 7/7 [00:00<00:00,  8.45it/s]
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["bos_token_id"]` will be overriden.
`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["eos_token_id"]` will be overriden.
Running on local URL:  http://127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
--------

I installed again after deleting the previous installation and it worked.

@2681248863
Copy link
Author

@nitinmukesh
(ootd) srp@eelab511-server:~/ootd/OOTDiffusion/run$ python gradio_ootd.py
Traceback (most recent call last):
File "/home/srp/ootd/OOTDiffusion/run/gradio_ootd.py", line 22, in
ootd_model_hd = OOTDiffusionHD(0)
File "/home/srp/ootd/OOTDiffusion/ootd/inference_ootd_hd.py", line 37, in init
vae = AutoencoderKL.from_pretrained(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 712, in from_pretrained
config, unused_kwargs, commit_hash = cls.load_config(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 365, in load_config
raise EnvironmentError(
OSError: Error no file named config.json found in directory ../checkpoints/ootd.

@nitinmukesh
Copy link

nitinmukesh commented Sep 22, 2024

@2681248863

Just try following the steps as shown in video, should work on Linux too. Start installing in different folder.

Also share the screenshot of checkpoints folder. There should be 4 folders inside it. Compare with the following .

C:\ai\OOTDiffusion\checkpoints>tree /F
Folder PATH listing for volume Windows-SSD
Volume serial number is 0000018C CE9F:A6AE
C:.
│   README.txt
│
├───clip-vit-large-patch14
│       .gitattributes
│       config.json
│       flax_model.msgpack
│       merges.txt
│       model.safetensors
│       preprocessor_config.json
│       pytorch_model.bin
│       README.md
│       special_tokens_map.json
│       tf_model.h5
│       tokenizer.json
│       tokenizer_config.json
│       vocab.json
│
├───humanparsing
│       exp-schp-201908261155-lip.pth
│       exp-schp-201908301523-atr.pth
│       parsing_atr.onnx
│       parsing_lip.onnx
│
├───ootd
│   │   model_index.json
│   │
│   ├───feature_extractor
│   │       preprocessor_config.json
│   │
│   ├───ootd_dc
│   │   └───checkpoint-36000
│   │       ├───unet_garm
│   │       │       config.json
│   │       │       diffusion_pytorch_model.safetensors
│   │       │
│   │       └───unet_vton
│   │               config.json
│   │               diffusion_pytorch_model.safetensors
│   │
│   ├───ootd_hd
│   │   └───checkpoint-36000
│   │       ├───unet_garm
│   │       │       config.json
│   │       │       diffusion_pytorch_model.safetensors
│   │       │
│   │       └───unet_vton
│   │               config.json
│   │               diffusion_pytorch_model.safetensors
│   │
│   ├───scheduler
│   │       scheduler_config.json
│   │
│   ├───text_encoder
│   │       config.json
│   │       pytorch_model.bin
│   │
│   ├───tokenizer
│   │       merges.txt
│   │       special_tokens_map.json
│   │       tokenizer_config.json
│   │       vocab.json
│   │
│   └───vae
│           config.json
│           diffusion_pytorch_model.bin
│
└───openpose
    └───ckpts
            body_pose_model.pth

@2681248863
Copy link
Author

@2681248863

只需尝试按照视频中所示的步骤操作,应该也可以在 Linux 上运行。开始在不同的文件夹中安装。

还要分享 checkpoints 文件夹的屏幕截图。里面应该有 4 个文件夹。与以下 .

C:\ai\OOTDiffusion\checkpoints>tree /F
Folder PATH listing for volume Windows-SSD
Volume serial number is 0000018C CE9F:A6AE
C:.
│   README.txt
│
├───clip-vit-large-patch14
│       .gitattributes
│       config.json
│       flax_model.msgpack
│       merges.txt
│       model.safetensors
│       preprocessor_config.json
│       pytorch_model.bin
│       README.md
│       special_tokens_map.json
│       tf_model.h5
│       tokenizer.json
│       tokenizer_config.json
│       vocab.json
│
├───humanparsing
│       exp-schp-201908261155-lip.pth
│       exp-schp-201908301523-atr.pth
│       parsing_atr.onnx
│       parsing_lip.onnx
│
├───ootd
│   │   model_index.json
│   │
│   ├───feature_extractor
│   │       preprocessor_config.json
│   │
│   ├───ootd_dc
│   │   └───checkpoint-36000
│   │       ├───unet_garm
│   │       │       config.json
│   │       │       diffusion_pytorch_model.safetensors
│   │       │
│   │       └───unet_vton
│   │               config.json
│   │               diffusion_pytorch_model.safetensors
│   │
│   ├───ootd_hd
│   │   └───checkpoint-36000
│   │       ├───unet_garm
│   │       │       config.json
│   │       │       diffusion_pytorch_model.safetensors
│   │       │
│   │       └───unet_vton
│   │               config.json
│   │               diffusion_pytorch_model.safetensors
│   │
│   ├───scheduler
│   │       scheduler_config.json
│   │
│   ├───text_encoder
│   │       config.json
│   │       pytorch_model.bin
│   │
│   ├───tokenizer
│   │       merges.txt
│   │       special_tokens_map.json
│   │       tokenizer_config.json
│   │       vocab.json
│   │
│   └───vae
│           config.json
│           diffusion_pytorch_model.bin
│
└───openpose
    └───ckpts
            body_pose_model.pth

对比你的文件和我的文件我发现了问题,我的文件名比你的多了一些前缀,我把文件名修改成和你的一样后就变成了另外的报错

@2681248863
Copy link
Author

Traceback (most recent call last):
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 371, in load_config
config_file = hf_hub_download(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/huggingface_hub/utils/_deprecation.py", line 101, in inner_f
return f(*args, **kwargs)
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 106, in _inner_fn
validate_repo_id(arg_value)
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 154, in validate_repo_id
raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../checkpoints/ootd/ootd_hd/checkpoint-36000'. Use repo_type argument if needed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/srp/ootd/OOTDiffusion/run/gradio_ootd.py", line 22, in
ootd_model_hd = OOTDiffusionHD(0)
File "/home/srp/ootd/OOTDiffusion/ootd/inference_ootd_hd.py", line 43, in init
unet_garm = UNetGarm2DConditionModel.from_pretrained(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 712, in from_pretrained
config, unused_kwargs, commit_hash = cls.load_config(
File "/home/srp/miniconda3/envs/ootd/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 407, in load_config
raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ../checkpoints/ootd/ootd_hd/checkpoint-36000 is not the path to a directory containing a config.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.

@nitinmukesh
Copy link

I still think you are not following the video guide.
try installing following the video tutorial.

@2681248863
Copy link
Author

好的,我再重新尝试一下

@RamtinKosari
Copy link

RamtinKosari commented Sep 24, 2024

i installed config and it fixed the problem, do :

pip install config

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

4 participants