pytorch / pytorch/tutorials

torchvision_finetuning_instance_segmentation.ipynb updates

Open
#2,235 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9.3k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
4

Description

Issue 1:

On following the colab notebook posted here, the run fails

ValueError                                Traceback (most recent call last)
[<ipython-input-19-b563ca732476>](https://83yy92n3d-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230302-060133-RC02_513678701#) in <module>
      4 # let's adda color palette to the mask.
----> 5 mask.putpalette([
      6     0, 0, 0, # black background
      7     255, 0, 0, # index 1 is red

2 frames
[/usr/local/lib/python3.8/dist-packages/PIL/Image.py](https://83yy92n3d-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230302-060133-RC02_513678701#) in _getdecoder(mode, decoder_name, args, extra)
    431     except AttributeError as e:
    432         raise OSError(f"decoder {decoder_name} not available") from e
--> 433     return decoder(mode, *args + extra)
    434 
    435 

ValueError: unknown raw mode for given image mode

Issue 2:

Path to MaskRCNN and FasterRCNN model architectures do not load
Screenshot 2023-03-06 at 6 40 22 PM

Fix:

  1. Enable P mode in mask before calling putpalette()
  2. Update image paths in colab

Since I do not have access to the original notebook and am unable to find the source, I have made a copy and updating the link in tutorial.

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 with intermediate_source/torchvision_tutorial.rst and follow its linked Colab notebook. Check the mask setup around putpalette() and the MaskRCNN and FasterRCNN image paths; done means the notebook loads the models and runs past the palette error with the updated link and paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
documentation, machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.