FileNotFoundError: [Errno 2] No such file or directory: '.data/multi30k/train.fr'
I'm trying to load Multi30k torchtext dataset using google colab. When I load the .de it works fine, but as soon as I changed from .de I get this error:
FileNotFoundError: [Errno 2] No such file or directory: '.data/multi30k/train.fr'

This is how I loaded the .de and it worked:
train_data, valid_data, test_data = datasets.Multi30k.splits(
    root=&quot;.data&quot;,
    exts=('.de', '.en'),
    fields = (SRC, TRG),
    
)

As soon as I changed this code by changing .de to .fr the error rises:
train_data, valid_data, test_data = datasets.Multi30k.splits(
    root=&quot;.data&quot;,
    exts=('.fr', '.en'),
    fields = (SRC, TRG),
    
)

Imports
import torch
from torch import nn
from torch.nn  import functional as F
import spacy, math, random
import numpy as np
from torchtext.legacy import datasets, data
import time
from prettytable import PrettyTable
from matplotlib import pyplot as plt

Seeds
SEED = 42
np.random.seed(SEED)
torch.manual_seed(SEED)
random.seed(SEED)
torch.cuda.manual_seed(SEED)
torch.backends.cudnn.deteministic = True

Tokenizers spacy
import spacy
spacy.cli.download('fr_core_news_sm')

spacy_fr = spacy.load('fr_core_news_sm')
spacy_en = spacy.load('en_core_web_sm')

def tokenize_fr(sent):
  return [tok.text for tok in spacy_fr.tokenizer(sent)]

def tokenize_en(sent):
  return [tok.text for tok in spacy_en.tokenizer(sent)]

Fields
SRC = data.Field(
    tokenize= tokenize_fr,
    lower= True,
    init_token = &quot;&lt;sos&gt;&quot;,
    eos_token = &quot;&lt;eos&gt;&quot;,
    include_lengths =True
)

TRG = data.Field(
    tokenize = tokenize_en,
    lower= True,
    init_token = &quot;&lt;sos&gt;&quot;,
     eos_token = &quot;&lt;eos&gt;&quot;
)

The cell that throws an error
train_data, valid_data, test_data = datasets.Multi30k.splits(
    root=&quot;.data&quot;,
    exts=('.fr', '.en'),
    fields = (SRC, TRG),
)


It's because there is no train.fr file in the dataset itself.
If you list down what pytorch downloaded,
$ !ls -al .data/multi30k
total 5.4M
drwxr-xr-x 2 root root 4.0K Jul 15 14:26 .
drwxr-xr-x 3 root root 4.0K Jul 15 14:26 ..
-rw-r--r-- 1 root root  65K Jul 15 14:26 mmt_task1_test2016.tar.gz
-rw-rw-r-- 1 1000 1000  69K Oct 17  2016 test2016.de
-rw-rw-r-- 1 1000 1000  61K Oct 17  2016 test2016.en
-rw-rw-r-- 1 1000 1000  71K Feb 11  2017 test2016.fr
-rw-rw-r-- 1 1000 1000 2.1M Feb  2  2016 train.de
-rw-rw-r-- 1 1000 1000 1.8M Feb  2  2016 train.en
-rw-r--r-- 1 root root 1.2M Jul 15 14:26 training.tar.gz
-rw-rw-r-- 1 1000 1000  75K Feb  2  2016 val.de
-rw-rw-r-- 1 1000 1000  62K Feb  2  2016 val.en
-rw-r--r-- 1 root root  46K Jul 15 14:26 validation.tar.gz

