Closed hari-aindra closed 4 years ago
The correct scaling depends on where you download the model from. Originally, all BiT models were trained with the [-1, 1] scaling and expect such scaling as input.
However, there is one exception: if you download BiT model from https://tfhub.dev, then the expected scaling is [0, 1], as tensorflow hub enforces such convention. If I am not mistaken, in this repository, TF2 colab is the only example, that uses hub models and, thus, expects [0, 1] scaling.
That solves the issue. Thanks
Do the tensor-hub model with 0-1 scaling have same performance(Accuracy) as of the original BIT models ?
Yes, they are exactly the same models and just do the conversion internally.
Normalization range for input to the network is not clearly defined.
The tutorial says it should be normalized to the range 0-1 here
features['image'] = tf.cast(features['image'], tf.float32) / 255.0
The training code on the other hand normalizes it to -1 to +1 here
im = (im - 127.5) / 127.5
Among these, which is the correct one?