borisdayma / dalle-mini

DALL·E Mini - Generate images from a text prompt
https://www.craiyon.com
Apache License 2.0
14.76k stars 1.22k forks source link

AttributeError: 'DalleBart' object has no attribute '_is_initialized' #172

Open Hamdan85 opened 2 years ago

Hamdan85 commented 2 years ago

Initialization failure

wandb: You can find your API key in your browser here: https://wandb.ai/authorize

wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit: ··········

wandb: Appending key for api.wandb.ai to your netrc file: /root/.netrc
wandb: Downloading large artifact wzoooa1c:latest, 1672.79MB. 7 files... Done. 0:0:0

---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

[<ipython-input-4-0247091842e9>](https://localhost:8080/#) in <module>()
      6 # Load dalle-mini
      7 model = DalleBart.from_pretrained(
----> 8     DALLE_MODEL, revision=DALLE_COMMIT_ID, abstract_init=True
      9 )
     10 

3 frames

[/usr/local/lib/python3.7/dist-packages/transformers/modeling_flax_utils.py](https://localhost:8080/#) in params(self, params)
    189     def params(self, params: Union[Dict, FrozenDict]):
    190         # don't set params if the model is not initialized
--> 191         if not self._is_initialized:
    192             raise ValueError(
    193                 "`params` cannot be set from model when the model is created with `_do_init=False`. "

AttributeError: 'DalleBart' object has no attribute '_is_initialized'
borisdayma commented 2 years ago

What transformers version do you use? It may be an issue with the new changes in master branch.

Edit: oh, I guess you're using the colab which uses master branch

borisdayma commented 2 years ago

I think the issue is fixed

upjabir commented 2 years ago
TypeError                              Traceback (most recent call last)
[<ipython-input-4-fa25138b8662>](https://localhost:8080/#) in <module>()
     10 
     11 # Load VQGAN
---> 12 vqgan = VQModel.from_pretrained(VQGAN_REPO, revision=VQGAN_COMMIT_ID)
     13 
     14 # Load CLIP

1 frames
[/usr/local/lib/python3.7/dist-packages/vqgan_jax/modeling_flax_vqgan.py](https://localhost:8080/#) in __init__(self, config, input_shape, seed, dtype, **kwargs)
    592       **kwargs,
    593   ):
--> 594     module = self.module_class(config=config, dtype=dtype, **kwargs)
    595     super().__init__(config,
    596                      module,

TypeError: __init__() got an unexpected keyword argument '_do_init' 
borisdayma commented 2 years ago

Thanks, it was an issue from another repo but should be fixed now