Tried to run train.py code in vehicle detection folder using jupyter notebook and it is giving error dataset is empty while initialising trainer module.
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\engine\defaults.py:378, in DefaultTrainer.init(self, cfg)
376 model = self.build_model(cfg)
377 optimizer = self.build_optimizer(cfg, model)
--> 378 data_loader = self.build_train_loader(cfg)
380 model = create_ddp_model(model, broadcast_buffers=False)
381 self._trainer = (AMPTrainer if cfg.SOLVER.AMP.ENABLED else SimpleTrainer)(
382 model, data_loader, optimizer
383 )
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\engine\defaults.py:547, in DefaultTrainer.build_train_loader(cls, cfg)
538 @classmethod
539 def build_train_loader(cls, cfg):
540 """
541 Returns:
542 iterable
(...)
545 Overwrite it if you'd like a different data loader.
546 """
--> 547 return build_detection_train_loader(cfg)
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\config\config.py:245, in _get_args_from_config(from_config_func, *args, *kwargs)
243 if name not in supported_arg_names:
244 extra_kwargs[name] = kwargs.pop(name)
--> 245 ret = from_config_func(args, **kwargs)
246 # forward the other arguments to init
247 ret.update(extra_kwargs)
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\data\build.py:344, in _train_loader_from_config(cfg, mapper, dataset, sampler)
342 def _train_loader_from_config(cfg, mapper=None, *, dataset=None, sampler=None):
343 if dataset is None:
--> 344 dataset = get_detection_dataset_dicts(
345 cfg.DATASETS.TRAIN,
346 filter_empty=cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS,
347 min_keypoints=cfg.MODEL.ROI_KEYPOINT_HEAD.MIN_KEYPOINTS_PER_IMAGE
348 if cfg.MODEL.KEYPOINT_ON
349 else 0,
350 proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None,
351 )
352 _log_api_usage("dataset." + cfg.DATASETS.TRAIN[0])
354 if mapper is None:
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\data\build.py:252, in get_detection_dataset_dicts(names, filter_empty, min_keypoints, proposal_files, check_consistency)
249 return dataset_dicts[0]
251 for dataset_name, dicts in zip(names, dataset_dicts):
--> 252 assert len(dicts), "Dataset '{}' is empty!".format(dataset_name)
254 if proposal_files is not None:
255 assert len(names) == len(proposal_files)
AssertionError: Dataset 'good_and_bad_weather_train' is empty!
Tried to run train.py code in vehicle detection folder using jupyter notebook and it is giving error dataset is empty while initialising trainer module.
AssertionError Traceback (most recent call last) Cell In [17], line 39 37 trainer = RotatedTrainer(cfg) 38 else: ---> 39 trainer = Trainer(cfg) 41 trainer.resume_or_load(resume=resume) 42 trainer.train()
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\engine\defaults.py:378, in DefaultTrainer.init(self, cfg) 376 model = self.build_model(cfg) 377 optimizer = self.build_optimizer(cfg, model) --> 378 data_loader = self.build_train_loader(cfg) 380 model = create_ddp_model(model, broadcast_buffers=False) 381 self._trainer = (AMPTrainer if cfg.SOLVER.AMP.ENABLED else SimpleTrainer)( 382 model, data_loader, optimizer 383 )
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\engine\defaults.py:547, in DefaultTrainer.build_train_loader(cls, cfg) 538 @classmethod 539 def build_train_loader(cls, cfg): 540 """ 541 Returns: 542 iterable (...) 545 Overwrite it if you'd like a different data loader. 546 """ --> 547 return build_detection_train_loader(cfg)
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\config\config.py:207, in configurable..wrapper..wrapped(*args, kwargs)
204 @functools.wraps(orig_func)
205 def wrapped(*args, *kwargs):
206 if _called_with_cfg(args, kwargs):
--> 207 explicit_args = _get_args_from_config(from_config, *args, kwargs)
208 return orig_func(explicit_args)
209 else:
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\config\config.py:245, in _get_args_from_config(from_config_func, *args, *kwargs) 243 if name not in supported_arg_names: 244 extra_kwargs[name] = kwargs.pop(name) --> 245 ret = from_config_func(args, **kwargs) 246 # forward the other arguments to init 247 ret.update(extra_kwargs)
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\data\build.py:344, in _train_loader_from_config(cfg, mapper, dataset, sampler) 342 def _train_loader_from_config(cfg, mapper=None, *, dataset=None, sampler=None): 343 if dataset is None: --> 344 dataset = get_detection_dataset_dicts( 345 cfg.DATASETS.TRAIN, 346 filter_empty=cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS, 347 min_keypoints=cfg.MODEL.ROI_KEYPOINT_HEAD.MIN_KEYPOINTS_PER_IMAGE 348 if cfg.MODEL.KEYPOINT_ON 349 else 0, 350 proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None, 351 ) 352 _log_api_usage("dataset." + cfg.DATASETS.TRAIN[0]) 354 if mapper is None:
File d:\jayamohan\project\hydrafusion\data\detectron2\detectron2\data\build.py:252, in get_detection_dataset_dicts(names, filter_empty, min_keypoints, proposal_files, check_consistency) 249 return dataset_dicts[0] 251 for dataset_name, dicts in zip(names, dataset_dicts): --> 252 assert len(dicts), "Dataset '{}' is empty!".format(dataset_name) 254 if proposal_files is not None: 255 assert len(names) == len(proposal_files)
AssertionError: Dataset 'good_and_bad_weather_train' is empty!