JSON2YOLO icon indicating copy to clipboard operation
JSON2YOLO copied to clipboard

TypeError: must be real number, not NoneType

Open stu0440 opened this issue 1 year ago • 3 comments

Annotations /root/autodl-tmp/datasets/coco/annotations/instancesonly_filtered_train.json: 4%|███▏ | 714/18732 [00:02<01:09, 257.80it/s] Traceback (most recent call last): File "general_json2yolo.py", line 396, in convert_coco_json( File "general_json2yolo.py", line 315, in convert_coco_json file.write(("%g " * len(line)).rstrip() % line + "\n") TypeError: must be real number, not NoneType

stu0440 avatar Sep 26 '24 05:09 stu0440

👋 Hello @stu0440, thank you for submitting a ultralytics/JSON2YOLO 🚀 issue!

To help us address your concern efficiently, please provide the following information:

  1. For bug reports:
    • A clear and concise description of the bug 🐛
    • A minimum reproducible example (MRE) that demonstrates the issue
    • Your environment details (OS, Python version, package versions)
    • Expected behavior vs. actual behavior
    • Any error messages or logs related to the issue – you've already included some of this, thank you!

Make sure to check if your issue has already been reported in existing issues to avoid duplicates.

🏷️ If you need to add more information, please comment on this issue. An Ultralytics engineer will assist you soon.

Thank you for contributing to the improvement of our project!

UltralyticsAssistant avatar Sep 26 '24 05:09 UltralyticsAssistant

I meet the same problem. I guess this is because the type of the dataset to be converted is inconsistent with COCO's native type. I solved this problem by adding the argument "cls91to88 = False" to the function "convert_coco"

huizhenlai avatar Oct 16 '24 06:10 huizhenlai

@huizhenlai thank you for sharing your solution. If the issue persists, please ensure you're using the latest version of the package. If you have further questions, feel free to ask.

pderrenger avatar Oct 16 '24 08:10 pderrenger