Skip to content
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

[Fix] Fix the bug that occurred when whitespace is in a new dataset path #370

Merged
merged 2 commits into from
Jul 29, 2021
Merged

Conversation

pvys
Copy link
Contributor

@pvys pvys commented Jul 24, 2021

When reorganizing a new dataset to the existing format, if whitespace is included in the path of that data, it'll be split into more than two values. It'll occur an error at the 1100th line for filename, gt_label in self.samples:
e.g.
For an annotation list like

ILSVRC  2012_val_00000001.JPEG 65
ILSVRC  2012_val_00000002.JPEG 970
ILSVRC  2012_val_00000003.JPEG 230
ILSVRC  2012_val_00000004.JPEG 809
ILSVRC  2012_val_00000005.JPEG 516
/mmclassification/mmcls/datasets/imagenet.py in load_annotations(self)
   1099         data_infos = []
-> 1100         for filename, gt_label in self.samples:
   1101             info = {'img_prefix': self.data_prefix}

ValueError: too many values to unpack (expected 2)

This'll fix the issue.

@CLAassistant
Copy link

CLAassistant commented Jul 24, 2021

CLA assistant check
All committers have signed the CLA.

@mzr1996
Copy link
Member

mzr1996 commented Jul 26, 2021

We will check it recently. Thanks for your contribution!

@mzr1996 mzr1996 self-requested a review July 26, 2021 10:21
@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #370 (92b9564) into master (c92eefb) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #370   +/-   ##
=======================================
  Coverage   76.02%   76.02%           
=======================================
  Files          96       96           
  Lines        5114     5114           
  Branches      849      849           
=======================================
  Hits         3888     3888           
  Misses       1108     1108           
  Partials      118      118           
Flag Coverage Δ
unittests 76.02% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcls/datasets/imagenet.py 24.48% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c92eefb...92b9564. Read the comment docs.

Copy link
Member

@mzr1996 mzr1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mzr1996 mzr1996 merged commit db856df into open-mmlab:master Jul 29, 2021
@pvys pvys deleted the fixBug branch July 29, 2021 05:53
mzr1996 added a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 2022
@OpenMMLab-Coodinator
Copy link

Hi @pvys !First of all, we want to express our gratitude for your significant PR in this project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR.

We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA

If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)
Thank you again for your contribution❤

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

Successfully merging this pull request may close these issues.

4 participants