stevenwudi / Kaggle_PKU_Baidu

Kaggle_PKU_Baidu
Apache License 2.0
71 stars 11 forks source link

configs.data.train中的train.csv错误 #66

Open enhenghengheng opened 4 years ago

enhenghengheng commented 4 years ago

您好,我在configs/htc/htc_hrnetv2p_w48_20e_kaggle_pku_no_semantic_translation_wudi.py文件中,想要使用kaggle的数据集train.csv,于是将config.data.train代码改成如下: `data = dict( imgs_per_gpu=1, workers_per_gpu=2, train=dict( type=dataset_type, data_root=data_root,

ann_file='/data/cyh/kaggle/kaggle_apollo_combine_6692.json',

    # ann_file=data_root + 'apollo_kaggle_combined_6725_wudi.json',
    ann_file='/data/Kaggle/pku-autonomous-driving/train.csv',  # 6691 means the final cleaned data
    img_prefix=data_root + 'train_images/',
    pipeline=train_pipeline,
    rotation_augmenation=True),`

但是产生错误: `runfile('/home/shi/data/Kaggle_pku/tools/train_kaggle_pku.py', wdir='/home/shi/data/Kaggle_pku/tools') 2020-04-07 13:00:48,313 - INFO - Distributed training: False 14%|█▍ | 11/79 [00:00<00:00, 77.85it/s]Loading Car model files... 100%|██████████| 79/79 [00:00<00:00, 109.19it/s] Traceback (most recent call last):

File "", line 1, in runfile('/home/shi/data/Kaggle_pku/tools/train_kaggle_pku.py', wdir='/home/shi/data/Kaggle_pku/tools')

File "/home/shi/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile execfile(filename, namespace)

File "/home/shi/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "/home/shi/data/Kaggle_pku/tools/train_kaggle_pku.py", line 100, in main()

File "/home/shi/data/Kaggle_pku/tools/train_kaggle_pku.py", line 78, in main datasets = [build_dataset(cfg.data.train)]

File "/home/shi/anaconda3/lib/python3.7/site-packages/mmdet-1.0rc0+unknown-py3.7-linux-x86_64.egg/mmdet/datasets/builder.py", line 39, in build_dataset dataset = build_from_cfg(cfg, DATASETS, default_args)

File "/home/shi/anaconda3/lib/python3.7/site-packages/mmdet-1.0rc0+unknown-py3.7-linux-x86_64.egg/mmdet/utils/registry.py", line 76, in build_from_cfg return obj_cls(**args)

File "/home/shi/anaconda3/lib/python3.7/site-packages/mmdet-1.0rc0+unknown-py3.7-linux-x86_64.egg/mmdet/datasets/custom.py", line 66, in init self.img_infos = self.load_annotations(self.ann_file)

File "/home/shi/anaconda3/lib/python3.7/site-packages/mmdet-1.0rc0+unknown-py3.7-linux-x86_64.egg/mmdet/datasets/kaggle_pku.py", line 75, in load_annotations annotations = json.load(open(outfile, 'r'))

File "/home/shi/anaconda3/lib/python3.7/json/init.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)

File "/home/shi/anaconda3/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s)

File "/home/shi/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/home/shi/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value` 请问这样的问题该如何解决?