pytorch / pytorch/vision

LSUN bedroom_train data load error

Open
#2,746 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted module: datasets new feature
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🐛 Bug

I am trying to load the lsun bedroom_train data from torchvision.dataset but it's returning an error.

To Reproduce

Steps to reproduce the behavior:

  1. import torch
  2. from torchvision import transforms
  3. from torchvision import datasets
  4. import os
  5. path = os.getcwd()
  6. train_transform = transforms.Compose([
  7. transforms.ToTensor(),
  8. transforms.Normalize((0.5,0.5,0.5), (0.5, 0.5, 0.5))])
  9. bedroom = datasets.LSUN(root = path, classes= ['bedroom_train'], transform=train_transform)

Error Traceback (most recent call last)
in
----> 1 bedroom = datasets.LSUN(root = path, classes= ['bedroom_train'], transform=train_transform)

D:\Softwares\Anaconda\lib\site-packages\torchvision\datasets\lsun.py in init(self, root, classes, transform, target_transform)
75 self.dbs.append(LSUNClass(
76 root=root + '/' + c + '_lmdb',
---> 77 transform=transform))
78
79 self.indices = []

D:\Softwares\Anaconda\lib\site-packages\torchvision\datasets\lsun.py in init(self, root, transform, target_transform)
17
18 self.env = lmdb.open(root, max_readers=1, readonly=True, lock=False,
---> 19 readahead=False, meminit=False)
20 with self.env.begin(write=False) as txn:
21 self.length = txn.stat()['entries']

Error: G:\DCGANs/bedroom_train_lmdb: No such file or directory

Expected behavior

The LSUN bedroom training dataset should be downloaded in specified path

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch / torchvision Version (e.g., 1.0 / 0.4.0): 1.6.0/0.7.0
  • OS (e.g., Linux): Windows 10
  • How you installed PyTorch / torchvision (conda, pip, source): conda
  • Build command you used (if compiling from source):
  • Python version: 3.7.7
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: NVIDIA GTX 1060 6GB
  • Any other relevant information:

Additional context

cc @pmeier

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading torchvision/datasets/lsun.py, especially LSUN and LSUNClass initialization, and reproduce the reported Windows 10 case with torchvision 0.7.0. Check how the dataset path and download behavior are expected to work; done means the reported bedroom_train loading failure is resolved or the required behavior and setup are clearly documented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.