microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
https://aka.ms/GeneralAI
MIT License
19.62k stars 2.5k forks source link

Running Inference without training #1164

Open TheLearner23 opened 1 year ago

TheLearner23 commented 1 year ago

Describe Model I am using (TextDiffuser) on windows machine with GPU:

I'm wondering if it's possible to run the inference.py for the "text_to_image" model without training??? I have already downloaded the checkpoints from this link (https://layoutlm.blob.core.windows.net/textdiffuser/textdiffuser-ckpt-new.zip?sv=2022-11-02&ss=b&srt=o&sp=r&se=2033-06-08T16:48:15Z&st=2023-06-08T08:48:15Z&spr=https&sig=a9VXrihTzbWyVfaIDlIT1Z0FoR1073VB0RLQUMuudD4%3D). However, when I run "text-to-image.sh", I get an error regarding this line in the code:

unet = UNet2DConditionModel.from_pretrained(args.resume_from_checkpoint, subfolder="unet", revision=None).cuda()

The error is:

huggingface_hub.utils._errors.RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-649db379-649556802cd9211e76df7d0b)

Repository Not Found for url: https://huggingface.co/None/resolve/main/unet/config.json. Please make sure you specified the correct repo_id and repo_type. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "inference.py", line 613, in main() File "inference.py", line 364, in main unet = UNet2DConditionModel.from_pretrained( File "C:\Users\ssmith\Desktop\textdiffuser\diffusers\src\diffusers\models\modeling_utils.py", line 514, in from_pretrained config, unused_kwargs, commit_hash = cls.load_config( File "C:\Users\ssmith\Desktop\textdiffuser\diffusers\src\diffusers\configuration_utils.py", line 362, in load_config raise EnvironmentError( OSError: None is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' If this is a private repository, make sure to pass a token having permission to this repo with use_auth_token or log in with huggingface-cli login.

JingyeChen commented 1 year ago

Thanks for your attention to our work!

The provided inference.py only serves for inference rather than training. Have you downloaded the pre-trained weight already? If the weights are successfully downloaded and the path of checkpoints are modified accordingly, such error will not be triggered.

nicholishiell commented 1 year ago

Hello JingyeChen, I am not able to download the pre-trained weights. It says public access is not allowed. Can you tell me where I can download the pre train files?