ImportError: cannot import name 'LightningEnum' from 'pytorch_lightning.utilities'

 

ImportError: cannot import name 'LightningEnum' from 'pytorch_lightning.utilities' (E:\Eprogramfiles\Anaconda3\lib\site-packages\pytorch_lightning\utilities\__init__.py)

 

E:\Eprogramfiles\Anaconda3\lib\site-packages\pytorch_lightning\trainer\states.py in <module>
     15 from typing import Optional
     16 
---> 17 from pytorch_lightning.utilities import LightningEnum
     18 
     19 
 
ImportError: cannot import name 'LightningEnum' from 'pytorch_lightning.utilities' (E:\Eprogramfiles\Anaconda3\lib\site-packages\pytorch_lightning\utilities\__init__.py)

 

 修改 \lib\site-packages\pytorch_lightning\trainer\states.py 文件,如上图。

posted @ 2022-05-03 20:49  emanlee  阅读(1203)  评论(0编辑  收藏  举报