tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

[Codelab]: Making Predictions from 2D Data

Open hjy1210 opened this issue 3 years ago • 6 comments

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.

tensorflow-qa

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?

hjy1210 avatar Aug 22 '22 10:08 hjy1210

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 avatar Aug 23 '22 19:08 jenperson

@jenperson After trying your code on Glitch, I still got the same result as I mentioned before. Following are some image I got: training evaluation

hjy1210 avatar Aug 24 '22 00:08 hjy1210

@jenperson After trying your code on Glitch on different devices.

  1. on my desktop computer, the accuracy is about 0.53. This is not normal.
  2. 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

hjy1210 avatar Sep 01 '22 00:09 hjy1210

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?

jenperson avatar Sep 01 '22 16:09 jenperson

Information of my desktop:

  1. Operation system : Windows 10 64bit
  2. CPU : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  3. Both Google Chrome and Microsoft Edge have the same result(Accuracy is about 52% on training, more than 80% on evaluation).
  4. On development console, execute tf.getBackend() got result : 'webgl'(same in Chrome and Edge)
  5. 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: @.***>

hjy1210 avatar Sep 01 '22 21:09 hjy1210

@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?

jenperson avatar Sep 06 '22 17:09 jenperson

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.

gaikwadrahul8 avatar Sep 03 '23 23:09 gaikwadrahul8

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.

github-actions[bot] avatar Sep 11 '23 01:09 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar Sep 19 '23 01:09 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Sep 19 '23 01:09 google-ml-butler[bot]