Same outputs after model.eval() in EfficientNet 3d model. #2895
-
When using EfficientNetBN model with 3 spatial dimension, model.train() works well, but model.eval() makes the same output. model.eval() should change the layers including BatchNorm, dropout, and so on, for evaludation mode (not training mode), but it might not work. pytoch ==1.7.0. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @yiheng-wang-nv , Could you please help take a look this ticket? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Hi @HyeonhoonLee , I did not detect this issue when using monai 0.6.0:
can you provided a detailed example for the issue you met? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @HyeonhoonLee , since I did not have your dataset, I used a MedMNIST 3D dataset (https://github.com/MedMNIST/MedMNIST) to do the test. |
Beta Was this translation helpful? Give feedback.
Hi @HyeonhoonLee , since I did not have your dataset, I used a MedMNIST 3D dataset (https://github.com/MedMNIST/MedMNIST) to do the test.
I found that the convergence speed for efficientnet-b1 is very slow compared with resnet10, it may be the reason that you detected same valid probabilties for different input samples.
I've uploaded the script for my test, can you please take a look at it?
If setting
total_epochs = 1
in the script, you will see same predictions viaprint(val_outputs)
, else if settingtotal_epochs=100
, you will see the predictions are different.test_3d.ipynb.zip