kenshohara / 3D-ResNets-PyTorch

3D ResNets for Action Recognition (CVPR 2018)
MIT License
3.91k stars 933 forks source link

Question about Training about ResNet-50 #141

Open amm040341 opened 5 years ago

amm040341 commented 5 years ago

Hello, I was trying to train resnet-50 from scratch on UCF101 split 1. but my validation accuracy(clip) is only about 40%. The accuracy is also 40% on resnet-18 which is trained from scratch. Is my batch_size too small? (I use 32 to be my batch size because I only have one GPU) Could you provide your accuracy training resnet-50 on UCF101 without using pretrained model or give me some suggest to raise the accuracy? Thank a lot!

here is my opt.json { "scales": [1.0, 0.84089641525, 0.7071067811803005, 0.5946035574934808, 0.4999999999911653], "sample_size": 112, "no_mean_norm": false, "no_val": false, "no_cuda": false, "checkpoint": 10, "dampening": 0.9, "begin_epoch": 1, "dataset": "ucf101", "model": "resnet", "initial_scale": 1.0, "root_path": "/home/shengya/3D-ResNets-PyTorch-master/", "learning_rate": 0.1, "resnet_shortcut": "A", "model_depth": 50, "arch": "resnet-50", "test_subset": "val", "scale_in_test": 1.0, "annotation_path": "/home/shengya/3D-ResNets-PyTorch-master/UCF101-jpg/ucf101_01.json", "wide_resnet_k": 2, "no_softmax_in_test": false, "nesterov": false, "mean": [0.4500972549019608, 0.42249176470588234, 0.39009803921568625], "n_classes": 101, "weight_decay": 0.0005, "test": false, "optimizer": "sgd", "mean_dataset": "activitynet", "pretrain_path": "", "std": [0.1519876776470588, 0.14855877368627451, 0.15697639709803923], "momentum": 0.9, "result_path": "/home/shengya/3D-ResNets-PyTorch-master/results", "train_crop": "random", "resnext_cardinality": 32, "resume_path": "", "lr_patience": 10, "no_hflip": false, "batch_size": 32, "video_path": "/home/shengya/3D-ResNets-PyTorch-master/UCF101-jpg", "ft_begin_index": 0, "norm_value": 255, "n_val_samples": 3, "n_epochs": 200, "n_threads": 4, "no_train": false, "std_norm": false, "n_scales": 5, "sample_duration": 16, "manual_seed": 1, "n_finetune_classes": 400, "crop_position_in_test": "c", "scale_step": 0.84089641525 }

Some lines of my train.log is as follows. 137 tensor(0.5792, device='cuda:0') tensor(0.8423, device='cuda:0') 1.0000000000000005e-08 138 tensor(0.5688, device='cuda:0') tensor(0.8408, device='cuda:0') 1.0000000000000005e-08

Some lines of my val.log is as follows. 136 tensor(3.0856, device='cuda:0') tensor(0.4030, device='cuda:0') 137 tensor(3.0993, device='cuda:0') tensor(0.3998, device='cuda:0') 138 tensor(3.1571, device='cuda:0') tensor(0.3999, device='cuda:0')

cientgu commented 5 years ago

hi, i meet the same problem when i train from scratch, did you find out the reason?

amm040341 commented 5 years ago

I believe the reason is UCF101 is a relatively small dataset. Model should pre-train on bigger dataset for instance Kinetics or sport1M then fine-tune on UCF101 for getting a better accuracy. I train my own model by this method can get almost 90% accuracy on UCF101.

DawnChou commented 4 years ago

Hey it seems that it's too late to find the issue. I met the same problem as you, the overfitting. I can only achieve almost 40% accuracy on test splits(UCF101). I am trying to fine-tune on UCF101. I was wondering if you used the same learning rate as the network from scratch or lower it?

YTHmamba commented 2 years ago

I believe the reason is UCF101 is a relatively small dataset. Model should pre-train on bigger dataset for instance Kinetics or sport1M then fine-tune on UCF101 for getting a better accuracy. I train my own model by this method can get almost 90% accuracy on UCF101.

@amm040341 hello ,Can you tell me the configuration in opts.py that you trained to 90% accuracy

87003697 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

breezexixixi commented 2 years ago

我相信原因是UCF101是一个相对较小的数据集。模型应该在更大的数据集上进行预训练,例如Kinetics或sport1M,然后在UCF101上进行微调以获得更好的精度。我用这种方法训练我自己的模型可以在UCF101上获得近90%的准确率。

hello ,Can you tell me the configuration in opts.py that you trained to 90% accuracy? thanks!

YTHmamba commented 2 years ago

我相信原因是UCF101是一个相对较小的数据集。模型应该在更大的数据集上进行预训练,例如Kinetics或sport1M,然后在UCF101上进行微调以获得更好的精度。我用这种方法训练我自己的模型可以在UCF101上获得近90%的准确率。

hello ,Can you tell me the configuration in opts.py that you trained to 90% accuracy? thanks!

请问你的精度是什么精度,原文中提到了Clip / Top-1 / Top-5 acc三种精度,我的精度是clip精度,请问为什么Top-1精度就比clip精度高呢,这三个精度有什么区别吗?十分感谢

87003697 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。