You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import json
import re
char_at_position = []
for i in range(36):
with open('./seg_result/result/'+str(i)+'.json') as file:
content = file.read()
pattern = r'\}(\r?\n)\{'
content = re.sub(pattern,'};\n{',content)
dictionaries = content.split(';')
i= 0
for dictionary in dictionaries:
data = json.loads(dictionary)
i = i+1
print(list(data.keys())[0])
with open('./seg_result/result/list.json', 'a') as file:
json.dump(data, file, indent=4, sort_keys=True)
file.write('\n')
比如:
.....
]
} (这里报错了,两个图片间)
{
"1": [
{
"000001": [
[
似乎不符合json的格式,缺少逗号之类的?请问如何解决呢?谢谢!
训练运作报错: raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1025 column 1 (char 23857)
The text was updated successfully, but these errors were encountered: