ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/
MIT License
1.05k stars 264 forks source link

Custom Segmentation - Errno 13 error #173

Open jtse606 opened 1 year ago

jtse606 commented 1 year ago

So I recently started trying to use the custom segmentation feature of Pixellib. I attempted to use the code to visualize a sample image:

import pixellib
from pixellib.custom_train import instance_custom_training

vis_img = instance_custom_training()
vis_img.load_dataset("Nature")
vis_img.visualize_sample()

When I run this code the conversion of Labelme annotations to COCO format seems to work fine, but then load_dataset throws the following error: PermissionError: [Errno 13] Permission denied:

I can't seem to figure out how to fix this even when looking at the underlying code - the one thing I think my be related is the fact that the above code creates a folder called "train.json" that has a JSON file inside it called "dataset.json." Does anyone have an idea on what to do here?

rk18venom commented 1 year ago

I also encountered the same problem according to the documentation it should create the file but it is making the folder so it might be Pixellib library is not updated with its latest version of the dependencies library.

Guide4Ever commented 1 year ago

This is solved with:

  1. On Google Collab (or other service) you need to make sure to restart your runtime. Delete folder train.json which has dataset.json in it. It is error with labelcoco.
  2. Run this - downgrading: !pip install pixellib==0.5.2 !pip install labelme2coco==0.1.0
  3. Run again.
  4. Profit.