Skip to content

Flowers102 dataset uses incorrect label indexing (uses 1-based indexing should be 0-based indexing) #5824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfb54 opened this issue Apr 16, 2022 · 1 comment

Comments

@jfb54
Copy link

jfb54 commented Apr 16, 2022

🐛 Describe the bug

The bug is simple. The Flowers102 dataset uses incorrect label indexing. It uses 1-based indexing and it should use 0-based indexing.

If you stop a debugger at this line, you will see that labels['labels'] contains the labels from 1 to 102. The labels should be zero indexed (i.e. 0 to 101) to follow pytorch conventions.

A simple fix is to add the following line after line 67:
labels['labels'] -= 1

Versions

Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.15.5
Libc version: glibc-2.10

Python version: 3.7.9 (default, Aug 31 2020, 12:42:55) [GCC 7.3.0] (64-bit runtime)
Python platform: Linux-5.4.0-1073-azure-x86_64-with-debian-buster-sid
Is CUDA available: N/A
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: Tesla V100-PCIE-16GB
Nvidia driver version: 460.91.03
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.2
[conda] blas 1.0 mkl
[conda] mkl 2020.2 256
[conda] mkl-service 2.3.0 py37he8ac12f_0
[conda] mkl_fft 1.2.0 py37h23d657b_0
[conda] mkl_random 1.1.1 py37h0573a6f_0
[conda] numpy 1.19.2 py37h54aff64_0
[conda] numpy-base 1.19.2 py37hfa32c7d_0

@NicolasHug
Copy link
Member

Thanks for the report @jfb54 , you're are right. This has already been reported in #5766, and the fix will be available in the next version of torchvision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants