labelme
labelme copied to clipboard
Invalid base64-encoded string: number of data characters (158533) cannot be 1 more than a multiple of 4
Discussed in https://github.com/wkentaro/labelme/discussions/1274
Originally posted by enamulrafti May 8, 2023
While executing labelme2coco.py I am facing the issue. The issue is:
_Traceback (most recent call last): File "C:\Users\User\anaconda3\lib\site-packages\labelme\label_file.py", line 108, in load imageData = base64.b64decode(data["imageData"]) File "C:\Users\User\anaconda3\lib\base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Invalid base64-encoded string: number of data characters (158533) cannot be 1 more than a multiple of 4
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\iar\prepocessing-codes\labelme2coco.py", line 222, in
and i have checked line no 108 in labelme.py which shows:
imageData = base64.b64decode(data["imageData"])
which i have tried to replace with this line:
imageData = base64.b64decode(data["imageData"] + '==')
which show this error:
Traceback (most recent call last): File "C:\Users\User\anaconda3\lib\site-packages\labelme\label_file.py", line 109, in load imageData = base64.b64decode(data["imageData"] + '==') File "C:\Users\User\anaconda3\lib\base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Invalid base64-encoded string: number of data characters (678697) cannot be 1 more than a multiple of 4
Help me! thanks in advance.