3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

Is the train.log right?

Open zy486at189cn opened this issue 6 years ago • 4 comments

@kenshohara

First , it is a great job!

I use the kinetics data to train a resnet-34-kinetics model. Every action have 50 MP4s. I train the model just like this: python3 main.py --root_path ~/3D-ResNets-PyTorch --video_path kineticsJPG --annotation_path kineticsjson/kinetics.json --result_path results --dataset kinetics --model resnet --model_depth 34 --resnet_shortcut A --pretrain_path models/resnet-34-kinetics.pth --n_classes 400 --batch_size 30 --n_threads 4 --checkpoint 5 It success to create a model "save_30.pth". My train.log file looks like this: epoch loss acc lr 21 5.05777625165984 0.050443081117927745 0.1 22 5.051979898375048 0.05023333857689686 0.1 23 5.037916659033671 0.05075769492947407 0.1 24 5.020105431997609 0.05448062503277227 0.1 25 5.006561265645096 0.05689266425462745 0.1 26 4.986441563412287 0.05615856536101935 0.1 27 4.982790104450624 0.05909496093545173 0.1 28 4.962981188055365 0.05883278275916313 0.1 29 4.957985667213246 0.06077290126369881 0.1 30 4.930375250401841 0.06276545540349221 0.1 Is it OK? When i use "video-classification-3d" to check the model , Command is: python3 main.py --input ./input --video_root ./videos --output ./output.json --model pathto/save_30.pth --mode score

I find the result is poor.

Why? Is the train.log right? Do i train the model sufficiently?

zy486at189cn avatar Apr 09 '18 14:04 zy486at189cn

Using --pretrain_path initializes the last fc layer. So, the training of the last fc may need more epochs. If you want to use my pretrained model, you should just use resnet-34-kinetics.pth. If you want to confirm the training loss and accuracy of my pretrained model, you should use not --pretrain_path but --resume_path.

kenshohara avatar Apr 10 '18 00:04 kenshohara

@kenshohara Very Thanks!

I use the resnet-34-kinetics.pth as the resume model,it can confirm the training.Command just like this: python3 main.py --root_path ~/3D-ResNets-PyTorch --video_path kineticsJPG --annotation_path kineticsjson/kinetics.json --result_path results --dataset kinetics --model resnet --model_depth 34 --resnet_shortcut A --resume_path models/resnet-34-kinetics.pth --n_classes 400 --batch_size 30 --n_threads 4 --checkpoint 5

When I use the trained model to detect MP4s,it can detect the MP4s right. such as cooking egg. But the train.log looks like this: epoch loss acc lr 251 3.0146184289757327 0.3498505584395155 0.00010000000000000003 252 2.9790674948516047 0.3603376854910597 0.00010000000000000003 253 2.9866867607000285 0.3545697656127104 0.00010000000000000003 254 2.9517760721602415 0.36495202139373917 0.00010000000000000003 255 2.934799548907158 0.3653190708405432 0.00010000000000000003 256 2.933299742612108 0.36830790205023334 0.00010000000000000003 257 2.899572157721034 0.3686749514970374 0.00010000000000000003 258 2.9151977803772007 0.3697236642021918 0.00010000000000000003 259 2.8628139520602836 0.379843741806932 0.00010000000000000003 260 2.886826454439834 0.3741806931990981 0.00010000000000000003 261 2.8730955221789127 0.3779036233023963 0.00010000000000000003 262 2.8713922783022165 0.37989617744218973 0.00010000000000000003 263 2.8699963414220853 0.37328928739971684 1.0000000000000004e-05 264 2.865433342598961 0.3804205337947669 1.0000000000000004e-05 265 2.874772745988758 0.37680247496198416 1.0000000000000004e-05 266 2.850167988643193 0.37900477164280844 1.0000000000000004e-05 267 2.850641434571832 0.3815741177704368 1.0000000000000004e-05 268 2.853663224027801 0.38204603848775626 1.0000000000000004e-05

The final acc is 0.38204603848775626! Is the train.log right?

zy486at189cn avatar Apr 19 '18 13:04 zy486at189cn

@kenshohara @zy486at189cn Hi, I got the accuracy of val.log, but I want to calculate the accuracy of video level, where can I get the val.json file and how to use eval_ucf101.py?

slighting666 avatar Jan 10 '20 03:01 slighting666

@slighting666 I have the same question as you, there seems to be no eval_UCf101.py file in the code in the master branch

YTHmamba avatar Jul 07 '22 15:07 YTHmamba