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

TypeError: DCAE_HF.__init__() missing 1 required positional argument: 'model_name' #53

Open
Aziily opened this issue Nov 27, 2024 · 9 comments
Labels
Answered Answered the question pachage version bug Bug due to the package version is not default

Comments

@Aziily
Copy link

Aziily commented Nov 27, 2024

When using the code in readme for inference without pre-downloading the models' weight, it seems that there will be such error.

I add one argument value in diffusion/model/builder.py to fix this.
To be specific, in line 88:

# ========== Mark this row ==========
# dc_ae = DCAE_HF.from_pretrained(model_path).to(device).eval()
# ========== Replace it with ==========
dc_ae = DCAE_HF.from_pretrained(model_path, model_name=model_path.split("/")[-1]).to(device).eval()

This seems to be an error required for correction.

@lawrence-cj
Copy link
Collaborator

Sry, but we don't meet this problem. Maybe the huggingface_hub=0.26.1 version is not the same with ours.
image

@Aziily
Copy link
Author

Aziily commented Nov 27, 2024

This may be a problem with my environment. My huggingface_hub version is 0.26.2.

@lawrence-cj
Copy link
Collaborator

If possible, could you try 0.26.1 to see if the bug will fix.

@lawrence-cj lawrence-cj added Answered Answered the question pachage version bug Bug due to the package version is not default labels Nov 27, 2024
@Aziily
Copy link
Author

Aziily commented Nov 28, 2024

I reinstall huggingface 0.26.1 and there seems to be no such error. Thank you for your help

@Aziily Aziily closed this as completed Nov 28, 2024
@chenzebiaohub
Copy link

chenzebiaohub commented Dec 20, 2024

huggingface-hub 0.27.0 @lawrence-cj

TypeError: DCAE_HF.init() missing 1 required positional argument: 'model_name'
dc_ae = DCAE_HF.from_pretrained(model_path).to(device).eval()
0.26.1 also can't run

@Aziily
Copy link
Author

Aziily commented Dec 20, 2024

huggingface-hub 0.27.0 @lawrence-cj

TypeError: DCAE_HF.init() missing 1 required positional argument: 'model_name' dc_ae = DCAE_HF.from_pretrained(model_path).to(device).eval() 0.26.1 also can't run

If you use the replacement I mentioned above, will this bug be fixed? So maybe this is not an error about the package version but whether the checkpoint is downloaded?

In my case, when I reinstalled 0.26.1 version, this bug is fixed. But I really forget whether the model has been downloaded.

@Aziily Aziily reopened this Dec 20, 2024
@chenzebiaohub
Copy link

Your meaning is that the model download weights might be incomplete or the path might be incorrect? @Aziily

@Aziily
Copy link
Author

Aziily commented Dec 20, 2024

Your meaning is that the model download weights might be incomplete or the path might be incorrect? @Aziily

Yeah, I mean maybe when the model downloaded, the model_name argument may not be required. So after downloading, the bug no longer exists.
But I don't know whether in your case the bug is fixed after the downloading, so this is just a guess.

@chenzebiaohub
Copy link

thanks !I try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered Answered the question pachage version bug Bug due to the package version is not default
Projects
None yet
Development

No branches or pull requests

3 participants