question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

VOCSegmentation -- RuntimeError: Dataset not found or corrupted. You can use download=True to download it

See original GitHub issue

๐Ÿ› Bug

I have downloaded the VOC Pascal Segmentation dataset and have it as following format:

/VOCdevkit
โ””โ”€โ”€ VOC2012
    โ”œโ”€โ”€ Annotations
    โ”œโ”€โ”€ ImageSets
    โ”‚   โ””โ”€โ”€ Segmentation
    โ”œโ”€โ”€ JPEGImages
    โ”œโ”€โ”€ SegmentationObject
    โ””โ”€โ”€ SegmentationClass

I am using the latest torch/torchvision version which is torch 1.7.1 and its corresponding torchvision. when I want to use the VOCSegmentation dataloader I get the following error:

import torch
import torchvision
dataset = torchvision.datasets.VOCSegmentation(root='/path/VOCdevkit/', year='2012', image_set='trainval', download=False)
Error:
RuntimeError                              Traceback (most recent call last)
<ipython-input-5-a979806cab30> in <module>
      1 import torch
      2 import torchvision
----> 3 dataset = torchvision.datasets.VOCSegmentation(root='/path/VOCdevkit/', year='2012', image_set='trainval', download=False)

~/anaconda3/envs/pytorch/lib/python3.6/site-packages/torchvision/datasets/voc.py in __init__(self, root, year, image_set, download, transform, target_transform, transforms)
    103         if not os.path.isdir(voc_root):
    104             raise RuntimeError('Dataset not found or corrupted.' +
--> 105                                ' You can use download=True to download it')
    106 
    107         splits_dir = os.path.join(voc_root, 'ImageSets/Segmentation')

RuntimeError: Dataset not found or corrupted. You can use download=True to download it

cc @pmeier

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasHugcommented, Apr 22, 2021

I tried root as both /path/VOCdevkit/VOC2012/ and /path/VOCdevkit/ and both of them generate error.

Did you try /path as suggested above?

0reactions
seyeeetcommented, Apr 22, 2021

It actually solved the issue!! Thanks a lot for your help, the solution was 1) move to pytorch 1.8.1 and 2) to do it with just /pathโ€ฆ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dataset not found or corrupted. You can use download=True ...
Solution to this problem is simply downloading this file from internet e.g. Kaggle. Problem number two. When using function CelebA function withย ...
Read more >
VOCDetection Dataset md5 has changed, no longer will load ...
RuntimeError : File not found or corrupted. Can be fixed by correcting the md5sum: from torchvision.datasets im... ... download=True)ย ...
Read more >
RuntimeError: Dataset not found. You can ... - PyTorch Forums
I was trying to download the MNIST dataset by the boilerplate code given on PyTorch official site. But first it gave Error 110:...
Read more >
SegmentationTest/data/VOC.py - RobustViT - Hugging Face
class VOCSegmentation(data.Dataset): ... raise RuntimeError('Dataset not found or corrupted.' +. ' You can use download=True to download it').
Read more >
torchๅŠ ่ฝฝๆ•ฐๆฎ้›†๏ผšDataset not found or corrupted. You can use ...
... or corrupted. You can use download=True to download it ... line 61, in __init__ raise RuntimeError('Dataset not found or corrupted.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found