JSON2YOLO icon indicating copy to clipboard operation
JSON2YOLO copied to clipboard

unsupported operand type(s) for +: 'WindowsPath' and 'str'

Open monkeycc opened this issue 3 years ago • 1 comments

Traceback (most recent call last):
  File "E:\JSON2YOLO-master\general_json2yolo.py", line 397, in <module>
    convert_vott_json(name='data',
  File "E:\JSON2YOLO-master\general_json2yolo.py", line 73, in convert_vott_json
    name = path + os.sep + name
TypeError: unsupported operand type(s) for +: 'WindowsPath' and 'str'

monkeycc avatar Sep 03 '22 09:09 monkeycc

@monkeycc it looks like you are encountering an unsupported operand type error in your general_json2yolo.py script. This issue occurs when trying to concatenate a WindowsPath object with a string using the + operator.

To resolve this, you can convert the WindowsPath object to a string before concatenating it with another string. You can do this by calling the str() function on the WindowsPath object.

After making this change, the concatenation should work as expected and resolve the unsupported operand type error.

glenn-jocher avatar Nov 10 '23 01:11 glenn-jocher