Scalsol / mega.pytorch

Memory Enhanced Global-Local Aggregation for Video Object Detection, CVPR2020
Other
566 stars 115 forks source link

Bug Question about validation while training #119

Open CyberPegasus opened 1 year ago

CyberPegasus commented 1 year ago

I try to run the training code for vid_R_50_C4_MEGA_1x.yaml. When i set SOLVER.TEST_PERIOD to a number > 0, then the error occurs :<, which said that the 'infos' dict has not attribute 'frame_category'. Then that comes the hard debugging time :<.

The 'infos' dict seems to be a copy of images, and the dataset for MEGA is 'VIDMEGADataset', which has '_get_train' and 'get_val' methods. These methods are called based on the param 'is_train' for function 'build_dataset' of 'make_data_loader'. Notice that build_dataset received 'is_train or is_for_period' for its param 'is_train', and the 'is_train or is_for_period' maintain 'True' for the training and validation mode, which may cause error. To fix this bug, should change the 'is_train or is_for_period' for in the line 166 'datasets = build_dataset(dataset_list, transforms, DatasetCatalog, is_train or is_for_period, cfg.MODEL.VID.METHOD)' of the 'mega_core/data/build.py' ?