drboog / Shifted_Diffusion

Code for Shifted Diffusion for Text-to-image Generation (CVPR 2023)
Creative Commons Zero v1.0 Universal
159 stars 11 forks source link

ckpt name seems not match #2

Closed howardgriffin closed 1 year ago

howardgriffin commented 1 year ago

IMG_2192

howardgriffin commented 1 year ago

When I run ‘python sft_test.py’, I encountered this promblem. Any suggestions to solve this problem?

drboog commented 1 year ago

Could you provide the library versions you are using (such as transformers, x_transformers) ?

howardgriffin commented 1 year ago

Could you provide the library versions you are using (such as transformers, x_transformers) ?

Here is my 'transformers' and 'x-transformers' library version of my environment: transformers 4.26.0 x-transformers 1.10.0

drboog commented 1 year ago

I guess maybe there is some library mismatching problem. As a result, the parameters in our checkpoint have different names with parameters of model you initialized (with another version of library).

I think you can print the name of parameters from checkpoint and model you initialized, compare them and manually change the names, then load the parameters.

Or you can install the version provided in our requirements.txt (create a new environment so that it won't influence your other projects).

howardgriffin commented 1 year ago

Thank you for your reply, I will have a try.

I guess maybe there is some library mismatching problem. As a result, the parameters in our checkpoint have different names with parameters of model you initialized (with another version of library).

I think you can print the name of parameters from checkpoint and model you initialized, compare them and manually change the names, then load the parameters.

Or you can install the version provided in our requirements.txt (create a new environment so that it won't influence your other projects).

howardgriffin commented 1 year ago

I change the the version of 'x_transformers' following your requirements, everything goes ok.