pytorch / pytorch/vision

Setting `flickr30k` to `root` argument of `Flickr30k()` gets error

Open
#8,750 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 flickr30k to root argument of Flickr30k() gets the error as shown below. *I used the absolute paths on Windows 11:

flickr30k
  |- Images
  |    |- *.jpg
  |   ...
  └ results_20130124.token
from torchvision import datasets

train_data = datasets.Flickr30k(
    root="C:/Users/<user>/dl-models/data/flickr30k/images", # Here
    ann_file="C:/Users/<user>/dl-models/data/flickr30k/results_20130124.token",
)

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7496: character maps to

from torchvision import datasets

train_data = datasets.Flickr30k(
    root="C:/Users/<user>/dl-models/data/flickr30k", # Here
    ann_file="C:/Users/<user>/dl-models/data/flickr30k/results_20130124.token",
)

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7496: character maps to

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

Start at the torchvision.datasets.Flickr30k() entry point and reproduce the Windows 11 failure with the supplied root and ann_file layout. Inspect how the annotation file is read and add coverage for this input; done means Flickr30k loads the provided annotations without the reported UnicodeDecodeError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.