Coder Social home page Coder Social logo

Comments (9)

plutorain avatar plutorain commented on June 15, 2024

I had same issue
I made two classes and It can works well on website.
But when I download tensorflow.js model, the model works well.
But keras model can't distinguish class
(in my case, The keras model shows high probability only for one class)

from teachablemachine-community.

HalfdanJ avatar HalfdanJ commented on June 15, 2024

Any chance you can share an example where this is clear? Both the teachable machine project and the python code you use to validate?

We have had a suspicion that there can be some difference, but we dont have a test dataset that clearly indicates it.

from teachablemachine-community.

GautamBose avatar GautamBose commented on June 15, 2024

Hi! We have recently updated the snippet available in Teachable Machine's Export panel to resize the images exactly how they are resized in the web app. Check it out and see if your classification performance improves.

from teachablemachine-community.

AliKarpuzoglu avatar AliKarpuzoglu commented on June 15, 2024

I reproduced the error @HalfdanJ and @GautamBose.
I tried it with both your version and with the fixed normalization I have in Pullrequest #81
Class 2-samples (2).zip
Class 1-samples (1).zip

Test Image used

Teachable machine returns 49-51 Class-1 Class-2
And Keras returns [0.546911 0.45308906] - or [0.5456604 0.45433962] with the new normalization
Should I upload the model, too?

from teachablemachine-community.

GautamBose avatar GautamBose commented on June 15, 2024

Hi! I suspect that something is causing models trained on different OS's, hardware, or browsers to behave differently. For example, when I downloaded your dataset and trained my own model, Teachable Machine gave me 78-22 Class-1 Class-2 on that test image... and keras returns [0.7885991 0.21140094], with the original normalization.

This is on MacOS 10.14.16 and Chrome 80.0.3987.116

To get to the bottom of this, what OS / browser are you using?

Screen Shot 2020-02-27 at 11 04 05 AM

from teachablemachine-community.

AliKarpuzoglu avatar AliKarpuzoglu commented on June 15, 2024

Mac OS 10.15.2 (19C57) and Chrome 80.0.3987.106 (64-bit)

from teachablemachine-community.

AliKarpuzoglu avatar AliKarpuzoglu commented on June 15, 2024

So I have tried training it again, and I got a result of 60-40
So the second time I got a result of 89 -11
The third time I got a 33 - 67
It makes sense that we have some randomness in the way you guys probably shuffle the image before training. ( I didn't look into the source code )

Edit: Now I did look into the source code, you shuffle it here, which causes the obvious deviations when running the same thing multiple times, It is weird that the second and third try had much smaller deviations though.

I used Colab for Keras, did you run it locally?

So I ran all of them in Colab and got this :

  1. 60- 40 -> [[0.831798 0.16820198]]
  2. 89- 11 -> [[0.906152 0.09384797]] (this ones good)
  3. 33 - 67 -> [[0.3598008 0.6401992]]

Colab uses : Python 3.6.9 and Ubuntu 18.04.3 LTS

from teachablemachine-community.

AhmetEnesYalcinkaya avatar AhmetEnesYalcinkaya commented on June 15, 2024

Is there any solution for this problem ? How can I get better result ?

from teachablemachine-community.

TowhidKashem avatar TowhidKashem commented on June 15, 2024

Having the same issue here, UI results are very accurate and in the form of x: 10%, y: 90% but the downloaded files using the provided code snippet for tensorflow.js are very different in the form of x: 0.47, y: 0.53 for the same test images

from teachablemachine-community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.