pytorch / pytorch/vision

Setting `"train"` to `classes` argument of `LSUN()` kills the kernel on JupyterLab

Open
#8,767 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🐛 Describe the bug

Setting "train" to classes argument of LSUN() kills the kernel on JupyterLab as shown below:
*Memos:

  • It also happens with ["bedroom_train"], ["church_outdoor_train"], ["classroom_train"], ["kitchen_train"], ["living_room_train"] and ["restaurant_train"] for classes argument.
  • "test" doesn't work because test_lmdb.zip, test_train_lmdb.zip and test_val_lmdb.zip cannot be unzipped as I reported the bug.
  • There is other error as I reported here.
from torchvision import datasets

train_data = datasets.LSUN(
    root="C:/Users/<user>/dl-models/data/lsun",
    classes="train" # Here
) # Error

print(len(train_data))

Screenshot 2024-11-29 222747

In addition, setting "val" to classes argument of LSUN() works properly on JupyterLab as shown below.
*Memos:

  • ["bedroom_train_val"], ["bridge_val"], ["church_outdoor_val"], ["classroom_val"], ["conference_room_val"], ["dining_room_val"], ["kitchen_val"], ["living_room_val"], ["restaurant_val"] and ["tower_val"] for classes argument also work properly.
  • test doesn't work because test_lmdb.zip, test_train_lmdb.zip and test_val_lmdb.zip cannot be unzipped as I reported the bug.
from torchvision import datasets

val_data = datasets.LSUN(
    root="C:/Users/<user>/dl-models/data/lsun",
    classes="val" # Here
)

print(len(val_data)) # 300
Versions
import torchvision

torchvision.__version__ # '0.20.1'

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

Reproduce the failure with torchvision 0.20.1 by constructing LSUN with classes="train" in JupyterLab, then compare it with the working classes="val" case. The issue names no source file or test, so trace LSUN dataset initialization and add a regression check once the training dataset no longer kills the kernel.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.