ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in coco dataset conversion: labelme2coco updated

ZL92 opened this issue · comments

commented

Hello,

The labelme2coco just got updated to v0.2.0. Consequently, the load_dataset() in custom training has an error.

Thanks for your effort in solving it in advance!

Hi, just coming here to bump this issue as well. Many thanks for your attention to this problem!

I've looked into it and there are at least two things that changed.

First, labelme2coco.convert now creates "dataset.json" file as output so code in "custom_train/init.py" would have to be changed from:
save_json_path1 = os.path.abspath(os.path.join(dataset, "train.json"))
self.dataset_train.load_data(save_json_path1, labelme_folder1)

to:
save_json_path1 = os.path.abspath(os.path.join(dataset, "coco/train"))
self.dataset_train.load_data(os.path.join(save_json_path1, "dataset.json"), labelme_folder1)

Second, labelme2coco now uses zero indexing for coco categories whereas here it is not allowed:
print('Error: Class id for "{}" cannot be less than one. (0 is reserved for the background)'.format(class_name))

Most likely there is more, this is just what I've found during a quick search.
I don't think that it can be resolved without attention from @ayoolaolafenwa.

commented

Hi all,

A solution that works for me: install the previous version of labelme2coco.

!pip3 install pixellib --upgrade
!pip3 install labelme2coco==v0.1.2

Hope this would help!

Hi all,

A solution that works for me: install the previous version of labelme2coco.

!pip3 install pixellib --upgrade
!pip3 install labelme2coco==v0.1.2

Hope this would help!

I tried the solution. But unfortunately no luck.

The new version didn't work. I had the same problem. Try this setting:

!pip3 install tensorflow==2.4.1
!pip3 install tensorflow--gpu
!pip3 install imgaug
!pip install pixellib --upgrade
!pip install labelme2coco==0.1.2

I used an old version and now is working.

Worked for me.