tfjs
tfjs copied to clipboard
[Codelab]: Making Predictions from 2D Data
In the article Handwritten digit recognition with CNNs , accuracy is about 0.8 after training. But accuracy is about 0.9 in evaluate section. I seems there are some accuracy mismatch.
I implement the program following exact the steps described in this article in my local computer. What I got something like the following image.
In training section, the accuracy is about 0.5. In evaluate section, the accuracy is about 0.75, much more than 0.5.
So my question is : How to explain the accuracy mismatch between two sections? Is there something wrong in the code?
The accuracy of the training and evaluation sections in the Codelab are quite similar. Looking at the graph, the training accuracy is closer to .9 than .8. I also ran through the Codelab myself and got similar results. Feel free to try out the code on Glitch.
As for your project, I can't make much of a determination without the code. The testing graph has an unusual shape for sure. Does that occur every time you run it? What happens if you increase TRAIN_DATA_SIZE and TEST_DATA_SIZE?
@jenperson After trying your code on Glitch, I still got the same result as I mentioned before. Following are some image I got:

@jenperson After trying your code on Glitch on different devices.
- on my desktop computer, the accuracy is about 0.53. This is not normal.
- on my android mobile, the accuracy is about 0.91. This is normal. I think there is something wrong in my desktop, can you figure out or guess how to fix my desktop. nodejs tensorflow.js conflict? setting problem?
Thanks in advance
Let's get some information about your system.
- What operating system do you use?
- What type of CPU/GPU does the computer have?
- What browser are you using? Are you able to try in a different browser and see if you get the same result?
Information of my desktop:
- Operation system : Windows 10 64bit
- CPU : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
- Both Google Chrome and Microsoft Edge have the same result(Accuracy is about 52% on training, more than 80% on evaluation).
- On development console, execute tf.getBackend() got result : 'webgl'(same in Chrome and Edge)
- Display card : Intel(R) HD Graphics 4600
On Fri, Sep 2, 2022 at 12:49 AM Jen Person @.***> wrote:
Let's get some information about your system.
- What operating system do you use?
- What type of CPU/GPU does the computer have?
- What browser are you using? Are you able to try in a different browser and see if you get the same result?
— Reply to this email directly, view it on GitHub https://github.com/tensorflow/tfjs/issues/6779#issuecomment-1234534113, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZGXVOFI7UPPJECT5NEDX3V4DM73ANCNFSM57HEZ7HA . You are receiving this because you authored the thread.Message ID: @.***>
@pyu10055 When executed this code on Glitch, they appear to get measurably lower accuracy on training as shown in the images above. Could this have something to do with the TF visualizer?
Hi, @hjy1210
Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.
The TFJs team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TFJs version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.
Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow.js space.
Thank you for your support and cooperation.
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.