Unable to import name '_TPU_AVAILABLE' from 'pytorch_lightning.utilities'
Asked Answered
I

4

6

I'm trying to import aitexten package to work on a GPT-2 solution. But I'm encountering an error:ImportError: cannot import name '_TPU_AVAILABLE' from 'pytorch_lightning.utilities' (/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/init.py)

enter image description here

I tried downgrading pytorch to v1.11.0 but that isn't helping too. Please help!

Intercommunion answered 4/11, 2022 at 16:6 Comment(0)
S
1

This worked for me in Google Colab. And it's with aitextgen version 0.6.

!pip uninstall -qqy torch torchvision torchtext torchaudio fastai
!pip install -qq torch==1.9.0 pytorch-lightning==1.7.7 aitextgen==0.6.0 
Scrip answered 16/12, 2022 at 10:1 Comment(0)
M
0

I ran into the same problem! I fixed it by downgrading aitextgen.

In the beginning of my notebook, I ran this command:

!pip3 install -q aitextgen==0.5.2

Make sure to restart your kernel.

Mentalist answered 5/11, 2022 at 7:0 Comment(1)
Thank you so much for your help! In my case v0.5.1 worked out for aitextgenIntercommunion
A
0

try this :

pytorch-lightning==1.4.0rc0
torchmetrics==0.6.0
aitextgen==0.5.2
Autogamy answered 30/11, 2022 at 11:23 Comment(0)
F
0

In my case

pip install -qq pytorch-lightning==1.7.7 aitextgen==0.6.0

Fixed it.

Firstclass answered 14/3, 2023 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.