Open joe1558 opened 1 year ago
尝试使用traceback在此处寻找到错误的原因
File "/home/ltsyl308/anaconda3/envs/py36/lib/python3.7/site-packages/pycocotools/coco.py", line 82, in __init__
dataset = json.load(f)
将原本coco文件中82行的代码
with open(annotation_file, 'r') as f:
dataset = json.load(f)
改为
try:
with open(annotation_file, 'r') as f:
dataset = json.load(f)
except Exception as e:
traceback.print_exc()
出现错误
File "/home/ltsyl308/anaconda3/envs/py36/lib/python3.7/site-packages/paddledet-0.0.0-py3.7.egg/ppdet/engine/trainer_ssod.py", line 491, in __init__
self.dataset, self.dataset_unlabel, cfg.worker_num)
File "/home/ltsyl308/anaconda3/envs/py36/lib/python3.7/site-packages/paddledet-0.0.0-py3.7.egg/ppdet/data/reader.py", line 536, in __call__
self.dataset_unlabel.parse_dataset()
File "/home/ltsyl308/anaconda3/envs/py36/lib/python3.7/site-packages/paddledet-0.0.0-py3.7.egg/ppdet/data/source/coco.py", line 402, in parse_dataset
coco = COCO(anno_path)
File "/home/ltsyl308/anaconda3/envs/py36/lib/python3.7/site-packages/pycocotools/coco.py", line 89, in __init__
assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
UnboundLocalError: local variable 'dataset' referenced before assignment
share your annotations .json file
这个应该是json文件的格式有问题
问题确认 Search before asking
请提出你的问题 Please ask your question
训练时使用如下命令python train.py -c configs/arsl_fcos_r50_fpn_coco_full.yml --eval出现以下错误,按照错误的描述是没能加载出json文件,查看配置文件内容也没有什么问题,metric设置的是coco,数据集路径也没有问题,json文件也可以正常打开和解析,不知道应该还要检查哪里去更改错误。