New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental results are not the same when run the code multiple times #6
Comments
Please provide more information about the difference, e.g., evaluation results in the log. |
for example, on TACoS, we get the results for the first running: +-------------+-------------+-------------+-------------+-------------+-------------+ and for the second running: +-------------+-------------+-------------+-------------+-------------+-------------+ some metric can differ a lot. |
Thank you LLLddddd. |
Hi,thanks for your reply. In order to make sure the hyper-parameters, random seed, etc are exactly the same, I re-download your entire official code. I only changed the following places of your code:
All the rest are the same as your official code. The log of the first running (first two epoch): nohup: ignoring input 2022-10-22 19:44:48,046 mmn INFO: Running with config:
0it [00:00, ?it/s] 2022-10-22 20:01:12,734 mmn.trainer INFO: eta: 5:43:11 epoch: 11/250 iteration: 10/19 loss_vid: 0.68 loss_sent: 0.96 loss_iou: 0.13 time: 23.59 max mem: 5931 0it [00:00, ?it/s] 2022-10-22 20:15:36,223 mmn.trainer INFO: eta: 5:29:31 epoch: 21/250 iteration: 10/19 loss_vid: 0.66 loss_sent: 0.93 loss_iou: 0.12 time: 24.75 max mem: 5931 the log of the second training: nohup: ignoring input 2022-10-22 19:47:02,182 mmn INFO: Running with config:
0it [00:00, ?it/s] 2022-10-22 20:03:29,082 mmn.trainer INFO: eta: 5:41:53 epoch: 11/250 iteration: 10/19 loss_vid: 0.69 loss_sent: 0.96 loss_iou: 0.13 time: 23.19 max mem: 5931 0it [00:00, ?it/s] 2022-10-22 20:18:48,761 mmn.trainer INFO: eta: 5:39:22 epoch: 21/250 iteration: 10/19 loss_vid: 0.66 loss_sent: 0.93 loss_iou: 0.12 time: 30.41 max mem: 5931 In addition, i'm not sure whether the environment has influence. My pytorch version is 1.7.0,python version is 3.6.6, cuda version is 10.2. I also test on the environment of pytorch 1.10.1, python 3.6.6, cuda 11.4, but i could not get same result as well. |
Thank you for the detailed log. I believe the randomness in my code is not completely removed, although I mannually set the random seed in Line 134 in be8db4b
Due to the randomness of negative sample selection in contrastive learning, it could lead to dramatic difference in gradients and affect the training process (especially in the TACoS dataset, due to that its videos commonly have 100+ sentences per video). I think the difference in evaluation metrics during the training process is not important, as long as the final results after convergence are similar between different trainings. Please compare your final results between your multiple trainings, and also compare it with the result reported in the paper. It will not be a problem if there is no huge performance gap. Just in case there is a huge performance gap, I will check it later. However, I believe there is no huge performance gap because the provided model parameters are trained just with this code in this version. |
Thanks a lot! If there is free time further, I'll appreciate it if you could check the randomness in your code. |
Hi,
It's a great work in moment localization and achieves significant results! I have some questions about the results when running codes for multiple times. It seems that for the same code and the same hyper parameters, experimental results are not the same when run the code twice.
Have you meet the same problem?Is there any solutions?
Thanks!
The text was updated successfully, but these errors were encountered: