开始训练报错MappedDataset和BatchedDataset
Created by: SPRCSY
完整错误信息如下,复制自aistudio
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last) work/PaddleDetection/ppdet/data/transform/transformer.py in _proxy_method(self, func, *args, **kwargs)
43 try:
---> 44 return func(*args, **kwargs)
45 except NotImplementedError: work/PaddleDetection/ppdet/data/dataset.py in reset(self)
47 raise NotImplementedError('%s.reset not available' %
---> 48 (self.__class__.__name__))
49
NotImplementedError: MappedDataset.reset not available
During handling of the above exception, another exception occurred:
NotImplementedError Traceback (most recent call last) work/PaddleDetection/ppdet/data/transform/transformer.py in _proxy_method(self, func, *args, **kwargs)
43 try:
---> 44 return func(*args, **kwargs)
45 except NotImplementedError:
work/PaddleDetection/ppdet/data/dataset.py in reset(self)
47 raise NotImplementedError('%s.reset not available' %
---> 48 (self.__class__.__name__))
49
NotImplementedError: BatchedDataset.reset not available
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)~/work/PaddleDetection/tools/train.py in <module>
338 help='Tensorboard logging directory for scalar.')
339 FLAGS = parser.parse_args()
--> 340 main()
work/PaddleDetection/tools/train.py in main()
150 eval_prog = eval_prog.clone(True)
151
--> 152 eval_reader = create_reader(eval_feed, args_path=FLAGS.dataset_dir)
153 eval_loader.set_sample_list_generator(eval_reader, place)
154
~/work/PaddleDetection/ppdet/data/data_feed.py in create_reader(feed, max_iter, args_path, my_source)
147
148 return Reader.create(feed.mode, data_config, transform_config, max_iter,
--> 149 my_source)
150
151
~/work/PaddleDetection/ppdet/data/reader.py in create(cls, mode, data_config, transform_config, max_iter, my_source, ret_iter)
138 reader = Reader({mode: data_config}, {mode: transform_config}, max_iter)
139 if ret_iter:
--> 140 return reader._make_reader(mode, my_source)
141 else:
142 return reader
~/work/PaddleDetection/ppdet/data/reader.py in _make_reader(self, mode, my_source)
89 batched_ds = batch_map(batched_ds, bm_config)
90
---> 91 batched_ds.reset()
92 if mode.lower() == 'train':
93 if self._cname2cid is not None:
work/PaddleDetection/ppdet/data/transform/transformer.py in _proxy_method(self, func, *args, **kwargs)
45 except NotImplementedError:
46 ds_func = getattr(self._ds, method)
---> 47 return ds_func(*args, **kwargs)
48
49
work/PaddleDetection/ppdet/data/transform/transformer.py in _proxy_method(self, func, *args, **kwargs)
45 except NotImplementedError:
46 ds_func = getattr(self._ds, method)
---> 47 return ds_func(*args, **kwargs)
48
49
work/PaddleDetection/ppdet/data/transform/transformer.py in _proxy_method(self, func, *args, **kwargs)
42 method = func.__name__
43 try:
---> 44 return func(*args, **kwargs)
45 except NotImplementedError:
46 ds_func = getattr(self._ds, method)
work/PaddleDetection/ppdet/data/transform/parallel_map.py in reset(self)
215 + " cannot start another epoch"
216
--> 217 self._source.reset()
218 self._consumed = 0
219 self._feeding_ev.set()
work/PaddleDetection/ppdet/data/source/roidb_source.py in reset(self)
129 """
130 if self._roidb is None:
--> 131 self._roidb = self._load()
132
133 self._samples = len(self._roidb)
work/PaddleDetection/ppdet/data/source/roidb_source.py in _load(self)
116 records, cname2cid = loader.load(self._fname, self._samples,
117 self._with_background, True,
--> 118 self.use_default_label, self.cname2cid)
119 self.cname2cid = cname2cid
120 return records
work/PaddleDetection/ppdet/data/source/loader.py in load(fname, samples, with_background, with_cat2id, use_default_label, cname2cid)
120 elif fname.endswith('.json'):
121 from . import coco_loader
--> 122 records, cname2cid = coco_loader.load(fname, samples, with_background)
123 elif "wider_face" in fname:
124 from . import widerface_loader
work/PaddleDetection/ppdet/data/source/coco_loader.py in load(anno_path, sample_num, with_background)
62 cname2cid = dict({
63 coco.loadCats(catid)[0]['name']: clsid
---> 64 for catid, clsid in catid2clsid.items()
65 })
66
work/PaddleDetection/ppdet/data/source/coco_loader.py in <dictcomp>(.0)
62 cname2cid = dict({
63 coco.loadCats(catid)[0]['name']: clsid
---> 64 for catid, clsid in catid2clsid.items()
65 })
66
TypeError: 'NoneType' object is not subscriptable