Karel911 / TRACER

TRACER: Extreme Attention Guided Salient Object Tracing Network (AAAI 2022) implementation in PyTorch
Apache License 2.0
195 stars 41 forks source link

Reproducible results #13

Closed MohamedAliRashad closed 2 years ago

MohamedAliRashad commented 2 years ago

I tested the model for some time and witnessed something strange. The same mask doesn't show up if i entered the same input image. It seems there is a random seed generator in the code that affects the output results.

Do you have any idea where something like this can happen ?

Karel911 commented 2 years ago

When I inference the test datasets (e.g., DUT-TE, DUT-O, etc...), I cannot observe any error. The random seed is fixed when TRACER initialized such that it cannot affect output results in inference phase.

What I understand is you used your own dataset, and the model could not predict the specific instance. The network generated the mask well for other instances?

MohamedAliRashad commented 2 years ago

I traced the problem and it turned out i was using the model without making it in the eval mode. The 3D Dropout used in the EfficientNet was causing the problem i think.

Karel911 commented 2 years ago

If your assumption is right, how about exclude the dropout in EfficientNet? Please set the dropout rate to 0.0 in the lines 493 to 502.

MohamedAliRashad commented 2 years ago

@Karel911 I fixed the problem with model.eval() ... it removed the dropout layers for consistent inference.