leeyeehoo / CSRNet-pytorch

CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes
642 stars 259 forks source link

It's hard to train ShanghaiPartA dataset, I got the best MAE with 250, but the paper gives about 70? #90

Open YuYue26 opened 3 years ago

YuYue26 commented 3 years ago

first: I didn't change any parameters in this code: args.original_lr = 1e-6 args.lr = 1e-7 args.batch_size = 1 args.momentum = 0.95 # 0.95 args.decay = 51e-4 # 51e-4 args.start_epoch = 0 args.epochs = 400 args.steps = [-1,1,100,150] args.scales = [1,1,1,1] args.workers = 4

second: I train from the vgg16 weights, and the inital code did something wrong with python 3.7, so I changed it as followed: self.frontend = make_layers(self.frontend_feat) self.backend = make_layers(self.backend_feat,in_channels = 512,dilation = True) self.output_layer = nn.Conv2d(64, 1, kernel_size=1) if not load_weights: mod = models.vgg16(pretrained = True) bb_dict = mod.state_dict() self._initialize_weights() pretrained_dict = self.frontend.state_dict() for keys, values in pretrained_dict.items(): pretrained_dict[keys] = bb_dict['features.'+ keys]

last: the avg loss in the train can reach around 300, it had a long way from the best MAE, so how can I do to reach the best MAE in ShanghaiTech partA

stupidoge commented 1 year ago

same....