Another version problem… I ran into it all. The version of
torchvision is too low, io.read_ Image does not support grayscale images. You can only read three channel color images…
segmentation = mask_to_rle(torchvision.io.read_image(os.path.join(self.root, m['mask']))[0] == 255)
current version
torchvision==0.8.2
Upgraded version
torchvision==0.9.0
Problem solved, yep! Of course, it is possible to solve the problem without upgrading torchvision. You can first convert the gray image into a three channel image, and you can try
(it’s also a reminder. Pay attention to the matching of torch versions)
Read More:
- [Solved] RuntimeError: cuda runtime error (801) : operation not supported at
- RuntimeError: No HIP GPUs are available [How to Solve]
- [How to Fix]RuntimeError: Python is not installed as a framework, If you are using (Ana)Conda
- [Solved] RuntimeError: ProcessGroupNCCL is only supported with GPUs, no GPUs found
- ‘c’ argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapp
- [Solved] RuntimeError: DefaultCPUAllocator: not enough memory: you tried to allocate 1105920 bytes.
- [Solved] RuntimeError: Numpy is not available (Associated Torch or Tensorflow)
- Windows10 DOTA_devkit Error: TypeError: ‘>=‘ not supported between instances of ‘NoneType‘ and ‘str‘
- [Solved] Pycham Error: non zero exit code (2)
- [Solved] error: the following arguments are required (Default parameters are set)
- Pyexcel Error: xlrd.biffh.XLRDError: Excel xlsx file; not supported
- [Solved] Matplotlib scatter Draw Error: TypeError: ufunc ‘sqrt‘ not supported for the input types…rule ‘‘safe‘‘
- [Solved] Odrive gui Error: Do not use the development server in a productioun and supported version of the Socket
- Facenet validate_on_lfw.py Error AssertionError: The number of LFW images must be an integer multip
- [Solved] python tqdm raise RuntimeError(“cannot join current thread“) RuntimeError: cannot join current thr
- [Solved] Pychart breakpoint error: frames are not available
- RuntimeError: Not implemented on the CPU [How to Solve]
- [Solved] RuntimeError: “unfolded2d_copy“ not implemented for ‘Half‘
- VScode debug error: configured debug type ‘Python’ is not supported
- `Model.XXX` is not supported when the `Model` instance was constructed with eager mode enabled