-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Different results for TFJS-Web vs Keras/TFJS-Node on same model and tensor #776
Comments
@ixio Thanks for reporting this issue. @bileschi I spend a few minutes trying to reproduce this issue on my machine but wasn't able to. Here are the environments in which I tested it
In all these environments, with the input that @ixio provided, I always get [[0.],], i.e., same as the result from @ixio's When I run @ixio's test.json in node, I also get [[0.],]. In addition, I tried the following artificial input data.
The four environments above always give the same result (up to numeric precision): Tensor So my gut feeling is that there is something peculiar with the way the In my browser (as well as my node.js environment), I get:
You might want to check the other values as well. |
Thank you for your feedback @caisq. I've tried your artificial input data, on nodejs I get the same outputs as you however in Firefox and Chromium I get I've tried Here is the output but since it's the same in as in node I don't think it's going to help you: I've tried using a js server instead of the python one: I've also made a POC with Docker (https://docs.docker.com/install/) which will hopefully help you figure this one out, I used the proposed artificial input data:
After about 30 seconds you should see the result |
I tested my docker poc with tfjs@0.13.3 and it looks like it's working. Thank you, whoever is responsible, for fixing this. |
TensorFlow.js version
Node:
Python:
Browser version
Firefox: 62.0.3 (64-bit)
Chromium: Version 69.0.3497.81 (Official Build) Built on Ubuntu , running on Ubuntu 18.04 (64-bit)
Describe the problem or feature request
I wanted to use a Keras-trained model in a JS application (Cordova/Ionic) so I used TensorFlow.js Python conversion however my test in a webpage shows different results from my Python predictions.
I made a small POC with the model and tensor (saved in JSON) and I posted a StackOverflow question: https://stackoverflow.com/questions/52683723/different-results-for-tensorflowjs-and-keras-on-same-model-and-tensor with no answers.
However I've now tried a small node script and I get the same result as the Python script, prediction of 0, while the browser version still predicts 1. I'm pretty sure that's a bug, right?
Code to reproduce the bug / link to feature request
Webpage version:
(I test it with
python3 -m http.server
)Result: Tensor [[1],]
Node version:
(I test it with
node test.js
)Result: Tensor [[0],]
DATA: poc_bug.zip
The text was updated successfully, but these errors were encountered: