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

[BUG] "IndexError: list index out of range" when edit label #963

Closed
hoozh opened this issue Dec 3, 2021 · 8 comments · Fixed by #1177
Closed

[BUG] "IndexError: list index out of range" when edit label #963

hoozh opened this issue Dec 3, 2021 · 8 comments · Fixed by #1177
Assignees
Labels
bug issue priority: high High priority

Comments

@hoozh
Copy link

hoozh commented Dec 3, 2021

Describe the bug
labelme crashed when edit label.

To Reproduce
Steps to reproduce the behavior:

  1. Load Labelme
  2. Click "Open Dir"
  3. Check "Save Automatically"
  4. Uncheck "Save With Image Data"
  5. Check "Keep Previous Annotation"
  6. Select last image in File List, and annotate it with a label
  7. Press A to open previous image,
  8. Edit the label
  9. Labelme crashed.

Expected behavior
Label can be updated.

Screenshots

Traceback (most recent call last):
  File "D:\Anaconda3\envs\labelme_env\lib\site-packages\labelme\app.py", line 1083, in editLabel
    self._update_shape_color(shape)
  File "D:\Anaconda3\envs\labelme_env\lib\site-packages\labelme\app.py", line 1163, in _update_shape_color
    r, g, b = self._get_rgb_by_label(shape.label)
  File "D:\Anaconda3\envs\labelme_env\lib\site-packages\labelme\app.py", line 1173, in _get_rgb_by_label
    item = self.uniqLabelList.findItemsByLabel(label)[0]
IndexError: list index out of range

Desktop (please complete the following information):

  • OS: Windows 10
  • Labelme Version 4.6.0

Additional context
Labelme Version 4.2.10 is Ok

@hoozh hoozh added the bug issue label Dec 3, 2021
@ShuaiLYU
Copy link

I have met the same bug. have you found a solution?

@hoozh
Copy link
Author

hoozh commented Apr 20, 2022

I have met the same bug. have you found a solution?

try another version

@floyddcn
Copy link

floyddcn commented May 24, 2022

Latest version 5.0.1 still has the crash problem when changing existing label value to a non-existing string value.
For me,the only choice seems to be a fallback to 4.2.10

@shihaoyin
Copy link

Latest version 5.0.1 still has the crash problem when changing existing label value to a non-existing string value.
For me,the only choice seems to be a fallback to 4.2.10

Have you solve the crash problem when editing labels?

@happyamyhope
Copy link

Describe the bug labelme crashed when edit label.

To Reproduce Steps to reproduce the behavior:

  1. Load Labelme
  2. Click "Open Dir"
  3. Check "Save Automatically"
  4. Uncheck "Save With Image Data"
  5. Check "Keep Previous Annotation"
  6. Select last image in File List, and annotate it with a label
  7. Press A to open previous image,
  8. Edit the label
  9. Labelme crashed.

Expected behavior Label can be updated.

Screenshots

Traceback (most recent call last):
  File "D:\Anaconda3\envs\labelme_env\lib\site-packages\labelme\app.py", line 1083, in editLabel
    self._update_shape_color(shape)
  File "D:\Anaconda3\envs\labelme_env\lib\site-packages\labelme\app.py", line 1163, in _update_shape_color
    r, g, b = self._get_rgb_by_label(shape.label)
  File "D:\Anaconda3\envs\labelme_env\lib\site-packages\labelme\app.py", line 1173, in _get_rgb_by_label
    item = self.uniqLabelList.findItemsByLabel(label)[0]
IndexError: list index out of range

Desktop (please complete the following information):

  • OS: Windows 10
  • Labelme Version 4.6.0

Additional context Labelme Version 4.2.10 is Ok

i crashed this problem today, and i will try older version.

@happyamyhope
Copy link

fix bug in editLabel #1151

#1151
this work for me

@PhpEssential
Copy link

Hi you can comment this line for quick fix, it's only used to change the color of the shape

in app.py line 1075 for the version 5.0.1
in editLabel function
#self._update_shape_color(shape)

@wkentaro
Copy link
Member

Will be fixed by v5.0.2

pip install --no-cache-dir labelme==5.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue priority: high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants