Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result of tf.image.resizeBilinear in Java is different from tf.image.resize In python #333

Open
mimilewis opened this issue Jun 6, 2021 · 5 comments

Comments

@mimilewis
Copy link

tf version in python:2.5.0
tf version in java :2.4.1
Result of tf.image.resizeBilinear in Java is different from tf.image.resize In python
tf.image.cropAndResize can get the same result

@Craigacp
Copy link
Collaborator

Craigacp commented Jun 7, 2021

Are you specifying halfPixelCenters = true when you run that op in Java? It's set to true by Python's resize.

@mimilewis
Copy link
Author

Are you specifying halfPixelCenters = true when you run that op in Java? It's set to true by Python's resize.

After using it, the result is closer.
python:[ 212.21364,222.1122,211.72565 ]
java: [212.25,222.25,211.81567]

@Craigacp
Copy link
Collaborator

Craigacp commented Jun 7, 2021

Are you running it on the same hardware (i.e. CPU or GPU) for both languages? Also can you check the behaviour of tf python 2.4.1?

@karllessard
Copy link
Collaborator

Just to let you know that I've just merge this PR to upgrade the current 0.4.0 snapshots to TensorFlow 2.5.

It should be ready to be tested out in about 8 hours from now and it could be interesting to see if that fixes the slight delta you are observing in the pixel values between Java and Python scaling (I have doubts but we never know).

@karllessard
Copy link
Collaborator

Ok, we had some trouble building the new snapshots with TF2.5 but it is ready now to be used for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants