Quantcast
Viewing all articles
Browse latest Browse all 14069

How to fix the pytorch data missing error?

I am trying to use an existing pytorch dataset:

!pip install torch==2.0.0 torchtext==0.15.1 numpy!pip install portalockerimport torchfrom torchtext.datasets import WikiText2from torchtext.data.utils import get_tokenizerfrom torchtext.vocab import build_vocab_from_iteratortrain_iter, valid_iter, test_iter = WikiText2(    root="data",    split=('train', 'valid', 'test'))num = 0for _ in train_iter:  num +=1print(f"Train size: {num}")

It gives me the following error:HTTPError: 403 Client Error: Forbidden for url: https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-2-v1.zip

I found the data here: https://github.com/pytorch/examples/tree/main/word_language_model/data/wikitext-2

But couldn't adjust the code to work with a different data source.


Viewing all articles
Browse latest Browse all 14069

Trending Articles