You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can anyone please help me understand how the retrain.py script normalize the image input data in TensorFlow Hub?
In the previous version of retrain.py (before TensorFlow Hub), it'll subtract pixels by 127.5 and then divide by 127.5, for a pixel in range [0, 255], this normalized its input to range [-1, 1], which seems to be correct.
In current retrain.py script, image was resized to 224x224 but the pixels were kept in range [0, 255], I know we have a module_apply_default/hub_input node in the graph to preprocess the input, however it seems that only multiples values by 2 and subtracts by 1.
I bet that we also divided the inputs by 255.0 somewhere, if so, the input will become [0, 1] before feeding into the module, and will be multiple by 2 and subtract by 1, and result a range [-1, 1].
My question is I didn't see where we divide the inputs by 255.0, so can anyone please clarify this?
Thanks!
The text was updated successfully, but these errors were encountered:
Can anyone please help me understand how the
retrain.py
script normalize the image input data in TensorFlow Hub?In the previous version of
retrain.py
(before TensorFlow Hub), it'll subtract pixels by 127.5 and then divide by 127.5, for a pixel in range [0, 255], this normalized its input to range [-1, 1], which seems to be correct.In current
retrain.py
script, image was resized to 224x224 but the pixels were kept in range [0, 255], I know we have amodule_apply_default/hub_input
node in the graph to preprocess the input, however it seems that only multiples values by 2 and subtracts by 1.I bet that we also divided the inputs by 255.0 somewhere, if so, the input will become [0, 1] before feeding into the module, and will be multiple by 2 and subtract by 1, and result a range [-1, 1].
My question is I didn't see where we divide the inputs by 255.0, so can anyone please clarify this?
Thanks!
The text was updated successfully, but these errors were encountered: