ry / tensorflow-resnet

ResNet model in TensorFlow
MIT License
1.66k stars 625 forks source link

Question about mean subtract #19

Open jamesclyeh opened 7 years ago

jamesclyeh commented 7 years ago

How come cafe model uses the mean subtracted image, while tensorflow model uses the original image? caffe_model = load_caffe(img_p, layers) vs. o = sess.run(i, {images: img[np.newaxis, :]})

I dont see _imagenet_preprocess() being used anywhere

I think you may have unintentionally deleted image net preprocessing in this commit https://github.com/ry/tensorflow-resnet/commit/6b42dfa6983bab0a2c1220f48dd451a63b803032

danielgordon10 commented 7 years ago

To me it looks like those commands are baked into the network loaded in forward. It does bgr to rgb, scaling, and mean subtraction.

jamesclyeh commented 7 years ago

Yes I guess that is true, but that may be because the network was trained when the mean subtraction was still there. If you train from scratch and save now, mean subtraction is probably not there.