Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: must be real number, not NoneType #106

Open
stu0440 opened this issue Sep 26, 2024 · 3 comments
Open

TypeError: must be real number, not NoneType #106

stu0440 opened this issue Sep 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@stu0440
Copy link

stu0440 commented Sep 26, 2024

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

@UltralyticsAssistant UltralyticsAssistant added the bug Something isn't working label Sep 26, 2024
@UltralyticsAssistant
Copy link
Member

👋 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!

@huizhenlai
Copy link

huizhenlai commented Oct 16, 2024

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"

@pderrenger
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants