728x90
<python />
ImportError: cannot import name 'TabularDataset' from 'torchtext.data'=
torchtext.data가 버전이 바뀌면서 torchtext.legacy로 바뀌었다고 한다.
<python />
from torchtext.legacy.data import TabularDataset
Error: No module named ‘torchtext.legacy’
구글링해보니 torchtext.legacy.data로 바꿔주면 된다 하는데 아무리 해도 안되서 torchtext버전을 강제로 지정해줬다
<python />
!pip install torchtext==0.10.1 --user
0.10.1 버전으로 설치하니 torchtext.legacy.data가 잘 작동한다.
'파이썬 > Tensorflow,Pytorch' 카테고리의 다른 글
순환 신경망(RNN) 클래스로 구현하기 (0) | 2022.12.19 |
---|---|
AttributeError: partially initialized module 'torch' has no attribute 'cuda' (most likely due to a circular import) (0) | 2022.12.18 |
자연어 처리 (2) | 2022.12.17 |
레고로 이해하는 LSTM, RNN (0) | 2022.12.16 |
케라스 Keras 공식문서 한글 번역본 (0) | 2022.12.16 |