miemie2013 / Pytorch-PPYOLO

ppyolo in pytorch. 44.8% box mAP.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wheemyungshin opened this issue · comments

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