How to read ImageNet dataset, val or test file?

username: Apisteutos84
cooked: <p>I am getting a RuntimeError. Recently I downloaded the ImageNet dataset from Kaggle and it is a large zip file. I just want to evaluate a trained dataset, but I can’t read the eval file.</p>
<pre><code class="lang-auto">path = "/home/me/Desktop/IMGNetDataset/imagenet-object-localization-challenge/ILSVRC/Data/CLS-LOC/val"


batch_size = 128

workers = 0

transform = transforms.Compose([ transforms.Resize(256),
                                    transforms.CenterCrop(224),
                                    transforms.ToTensor(),
                                    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
                                  ])

preprocessing = dset.ImageNet(root=import_dataset,
                                                    transform = transform )
                                
test_sampler = SequentialSampler(preprocessing)


dataloader = DataLoader(preprocessing, batch_size=batch_size, sampler= test_sampler,
                               shuffle=False, num_workers=workers)




</code></pre>
<p>There is not such file  ILSVRC2012_devkit_t12.tar.gz in the downloaded dataset.</p>
<pre><code class="lang-auto">RuntimeError: The archive ILSVRC2012_devkit_t12.tar.gz is not present in the root directory or is corrupted. You need to download it externally and place it in /home/me/Desktop/IMGNetDataset/imagenet-object-localization-challenge/ILSVRC/Data/CLS-LOC/.
</code></pre>

username: AbdulsalamBande
cooked: <p>I had a similar issue before. Anyways, The error message indicates that the file <code>ILSVRC2012_devkit_t12.tar.gz</code> is missing or corrupted. Try Downloading the file from the original source and place it in the proper directory.</p>

username: Apisteutos84
cooked: <p>Thanks, but now works only with the “train” file and doesn’t recognize any “val” file.</p>
<pre><code class="lang-auto">
preprocessing = dset.ImageNet(root=datapath,
                                  split="val",
                                  transform= transform)


FileNotFoundError: Couldn't find any class folder in /home/me/Desktop/IMGNetDataset/imagenet-object-localization-challenge/ILSVRC/Data/CLS-LOC/val.
</code></pre>
<p>The file “val” contains <code>ILSVRC2012_val_00000001.JPEG</code> , I don’t know if is it in the right form. The train file contains subfolders</p>

username: sinatv52
cooked: <p>I checked the ImageNet dataset in google Colab. There is no problem. That file name is fine.<br>
I used the links below to download “val”:</p>
<p><code>!wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_train.tar --no-check-certificate</code><br>
and<br>
<code>!wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar --no-check-certificate</code></p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/0/1089bc5a79f1c940419c4a9333440b8377c14513.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/1089bc5a79f1c940419c4a9333440b8377c14513" title="Screenshot (434)"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/1089bc5a79f1c940419c4a9333440b8377c14513_2_690x373.jpeg" alt="Screenshot (434)" data-base62-sha1="2miJH762u0M5Xc4gBbRFFUj5ssj" width="690" height="373" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/1089bc5a79f1c940419c4a9333440b8377c14513_2_690x373.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/1089bc5a79f1c940419c4a9333440b8377c14513_2_1035x559.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/1089bc5a79f1c940419c4a9333440b8377c14513_2_1380x746.jpeg 2x" data-dominant-color="31424B"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot (434)</span><span class="informations">1541×834 239 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: Apisteutos84
cooked: <p>Yes it works now, for train and val, what about test file? There is no option in PyTorch for splitting also the test file.</p>