DALLE-pytorch icon indicating copy to clipboard operation
DALLE-pytorch copied to clipboard

Cant run example models in colab due to lightning error

Open neramas1221 opened this issue 2 years ago • 4 comments

Hi, I've tried a few of the notebooks you provided for the examples but I run in to the same error across all of them in colab with the following error:

ImportError                               Traceback (most recent call last)
[<ipython-input-6-548ac97a7512>](https://localhost:8080/#) in <module>
     15 # dalle classes
     16 
---> 17 from dalle_pytorch import DiscreteVAE
     18 
     19 # constants

4 frames
[/usr/local/lib/python3.7/dist-packages/taming/main.py](https://localhost:8080/#) in <module>
     10 from pytorch_lightning.trainer import Trainer
     11 from pytorch_lightning.callbacks import ModelCheckpoint, Callback, LearningRateMonitor
---> 12 from pytorch_lightning.utilities.distributed import rank_zero_only
     13 
     14 def get_obj_from_str(string, reload=False):

ImportError: cannot import name 'rank_zero_only' from 'pytorch_lightning.utilities.distributed' (/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/distributed.py)

I think the version of lightning that is installed by the script might be incorrect now?

Any help getting this fixed is greatly appreciated!

Thanks

neramas1221 avatar Nov 02 '22 09:11 neramas1221

Any solution?

iamnmn9 avatar Jun 22 '23 06:06 iamnmn9

Any solution to this?

ashutoshbagga avatar Aug 02 '23 07:08 ashutoshbagga

any solution to this? facing the same in conda 3.9.7 and python3 (3.11.5) as well.

varshasrinivasan95 avatar Sep 24 '23 03:09 varshasrinivasan95

I got this to work by manually installing pytorch-lightning==1.9.0 instead of >2.0.0 (rank_zero_only is deprecated).

vaikzs avatar Sep 25 '23 06:09 vaikzs