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

(Validation Error with Pascal VOC) TypeError: Object of type int32 is not JSON serializable #2

Open
wheemyungshin opened this issue Oct 21, 2020 · 0 comments

Comments

@wheemyungshin
Copy link

Hello, Thank you for your good work.
I tested the Pascal VOC data with your annotation but an error occurred (which didn't happen with COCO dataset)

Error Message:

Traceback (most recent call last):
  File "eval.py", line 91, in <module>
    box_ap = eval(_decode, images, eval_pre_path, anno_file, eval_batch_size, _clsid2catid, draw_image, draw_thresh)
  File "/root/volume/Pytorch-PPYOLO/tools/cocotools.py", line 161, in eval
    json.dump(bbox_data, f)
  File "/opt/conda/lib/python3.7/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/opt/conda/lib/python3.7/json/encoder.py", line 429, in _iterencode
    yield from _iterencode_list(o, _current_indent_level)
  File "/opt/conda/lib/python3.7/json/encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "/opt/conda/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/opt/conda/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/opt/conda/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type int32 is not JSON serializable

It seems like,
in

json.dump(bbox_data, f)

,
bbox_data is list while input parameter of json.dump should be dictionary.

Would you help me to run the validation code?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant