!pip install tokenizers
!pip install torchdata
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchtext.datasets import Multi30k
And I get the following error:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchvision 0.14.1+cu116 requires torch==1.13.1, but you have torch 2.0.0 which is incompatible.
torchtext 0.14.1 requires torch==1.13.1, but you have torch 2.0.0 which is incompatible.
torchaudio 0.13.1+cu116 requires torch==1.13.1, but you have torch 2.0.0 which is incompatible.
fastai 2.7.11 requires torch<1.14,>=1.7, but you have torch 2.0.0 which is incompatible.
Is this related to the release of PyTorch 2.0? If so, how can I fix this? I suppose I need to use torch 1.13.1 but I don’t know how.
In the github page, the new 0.15.1 version was not listed, so that’s why I assumed torchtext wasn’t available to be used with torch 2.0.0.
I tried installing torchtext 0.15.1 and it works with torch 2.0.0 as you stated.
However, I believe my issue is with torchdata. When I do !pip install torchdata it installs the latest 0.6.0 version which has problems with the Multi30k dataset, which may be related to DataLoader.
I’m using the torchdata 0.5.1 now and it seems to be working.
Since torchdata 0.5.1 doesn’t work with torch 2.0.0, I assume new version of PyTorch is not reliable for people who wants to use torchdata. But for now, my issue is fixed, I hope they fix the problem with DataLoader in the new version of torchdata.
When I use ‘pip3 install torch==1.13.1 torchdata==0.5.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117’,
it raised a conflict;
but when I install torchdata in the end, it run smoothly.
Anybody know the reason?