bilylee / SiamFC-TensorFlow

A TensorFlow implementation of the SiamFC tracker
MIT License
358 stars 112 forks source link

验证过程和测试过程的区别。 #75

Closed noUmbrella closed 5 years ago

noUmbrella commented 5 years ago

您好,我发现这份代码在验证的时候和测试过程貌似是不一样的。验证过程中,bn层用的是当前batch的统计量,而测试中,bn层用的是保存模型的统计量,是这样的吗?貌似bn的操作在训练和验证中是一样的,按理来说,应该验证和测试是一样的呀。

bilylee commented 5 years ago

你好,BN 在验证和测试是一样的。

注意到 validation model 的 mode = ‘validation’ https://github.com/bilylee/SiamFC-TensorFlow/blob/c4f21d137257cb7685a8e3e74105f9be0d24afb4/train_siamese_model.py#L105

注意到当 model 不等于 ‘train’ 时 self.is_training() == False https://github.com/bilylee/SiamFC-TensorFlow/blob/c4f21d137257cb7685a8e3e74105f9be0d24afb4/siamese_model.py#L47-L49

此时模型的 arg_scope is_training=False https://github.com/bilylee/SiamFC-TensorFlow/blob/c4f21d137257cb7685a8e3e74105f9be0d24afb4/siamese_model.py#L91-L93

Batch norm 设置为 test 模式: https://github.com/bilylee/SiamFC-TensorFlow/blob/c4f21d137257cb7685a8e3e74105f9be0d24afb4/embeddings/convolutional_alexnet.py#L27-L69