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

Error when extracting semantic segmentation json from panoptic segmentation json #43

Open
matteosodano opened this issue May 3, 2021 · 2 comments

Comments

@matteosodano
Copy link

Following these indications, I am trying to obtain the json file for semantic segmentation, starting from the json file for panoptic segmentation.

The command that I used:
python converters/panoptic2semantic_segmentation.py --input_json_file /path/to/json/panoptic_<train, val>2017.json --output_json_file /path/to/json/semantic_<train, val>2017.json

The error:

 File "converters/panoptic2semantic_segmentation.py", line 210, in <module>
   extract_semantic(args.input_json_file,
 File "converters/panoptic2semantic_segmentation.py", line 174, in extract_semantic
   json.dump(d_coco, out)
 File "/usr/lib/python3.8/json/__init__.py", line 179, in dump
   for chunk in iterable:
 File "/usr/lib/python3.8/json/encoder.py", line 431, in _iterencode
   yield from _iterencode_dict(o, _current_indent_level)
 File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
   yield from chunks
 File "/usr/lib/python3.8/json/encoder.py", line 325, in _iterencode_list
   yield from chunks
 File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
   yield from chunks
 File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
   yield from chunks
 File "/usr/lib/python3.8/json/encoder.py", line 438, in _iterencode
   o = _default(o)
 File "/usr/lib/python3.8/json/encoder.py", line 179, in default
   raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

Other information: I successfully used the converter for the images (from panoptic json to folder with semantic segmentation png) with both the training and validation set.

Python version: 3.8.5

@italosalgado14
Copy link

Use "python2" insted of "python" in your command. Saludos!

@dokunima
Copy link

dokunima commented Jan 1, 2022

@matteosodano did you find a solution?

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

3 participants