lucidrains / DALLE-pytorch

Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch
MIT License
5.57k stars 642 forks source link

DeepSpeed is used outside of training #165

Closed TheoCoombes closed 3 years ago

TheoCoombes commented 3 years ago

When attempting to run generate.py, it results in the following error:

Traceback (most recent call last):
  File "generate.py", line 61, in <module>
    vae = OpenAIDiscreteVAE()
  File "D:\Documents\openai dall-e\DALLE-pytorch\dalle_pytorch\vae.py", line 92, in __init__
    self.enc = load_model(download(OPENAI_VAE_ENCODER_PATH))
  File "D:\Documents\openai dall-e\DALLE-pytorch\dalle_pytorch\vae.py", line 54, in download
    if deepspeed_utils.is_local_root_worker():
  File "D:\Documents\openai dall-e\DALLE-pytorch\dalle_pytorch\deepspeed_utils.py", line 110, in is_local_root_worker
    return get_local_rank() == ROOT_RANK
  File "D:\Documents\openai dall-e\DALLE-pytorch\dalle_pytorch\deepspeed_utils.py", line 91, in get_local_rank
    require_init()
  File "D:\Documents\openai dall-e\DALLE-pytorch\dalle_pytorch\deepspeed_utils.py", line 53, in require_init
    assert using_deepspeed is not None, \
AssertionError: DeepSpeed has not been initialized; please call `deepspeed_utils.init_deepspeed` at the start of your script

Here's my input command: py generate.py --dalle_path "dalle.pt" --text "a blue ocean and golden sand" --num_images 2

Should DeepSpeed be initialized in generate.py?

lucidrains commented 3 years ago

@TheoCoombes Hi Theo! Let me know if https://github.com/lucidrains/DALLE-pytorch/commit/19d8778be848bcd12e3e7672ff4ac723883111ed fixes things!

TheoCoombes commented 3 years ago

All good now, many thanks!