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

Wrong x-axis label order #2212

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Wrong x-axis label order #2212

wants to merge 3 commits into from

Conversation

FrankXu1
Copy link

Just take a look at this chapter's graph
www.tensorflow.org/tutorials/audio/simple_audio#run_inference_on_an_audio_file
You may find It is wrong actually. Result is not campatible with the words.
It seems you posted the wrong order of x-axis labels.
The correct order is followed by initial characters by alphabet order.
So I propose it should be ['down', 'go', 'left', 'no', 'right', 'stop', 'up', 'yes']
I am not so sure whether there are any hidden possible order I did not notice from this.
If have, please tell me and then take the correction order.

@FrankXu1 FrankXu1 requested a review from a team as a code owner March 29, 2023 09:30
@google-cla
Copy link

google-cla bot commented Mar 29, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions
Copy link

Preview

Preview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.

Format and style

Use the TensorFlow docs notebook tools to format for consistent source diffs and lint for style:
$ python3 -m pip install -U --user git+https://github.com/tensorflow/docs

$ python3 -m tensorflow_docs.tools.nbfmt notebook.ipynb
$ python3 -m tensorflow_docs.tools.nblint --arg=repo:tensorflow/docs notebook.ipynb
If commits are added to the pull request, synchronize your local branch: git pull origin master

@MaskedFaceDataSet
Copy link

I agreed to @FrankXu1.
After we reorder the label, the model predicted correctly.

I am not sure if we can put the label in this way or not. but seem the model work well after reorder the label and testing with other inferent data.

@vijayasarathib
Copy link
Contributor

This looks good to me

Copy link
Member

@markmcd markmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, just one little request.

@@ -826,7 +826,7 @@
"x = x[tf.newaxis,...]\n",
"\n",
"prediction = model(x)\n",
"x_labels = ['no', 'yes', 'down', 'go', 'left', 'up', 'right', 'stop']\n",
"x_labels = ['down', 'go', 'left', 'no', 'right', 'stop', 'up', 'yes']\n",
"plt.bar(x_labels, tf.nn.softmax(prediction[0]))\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"plt.bar(x_labels, tf.nn.softmax(prediction[0]))\n",
"plt.bar(label_names, tf.nn.softmax(prediction[0]))\n",

I think instead of hard-coding them here, we can just use the label_names variable that is created earlier, and used throughout this guide (so you need to delete the previous line too).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WangYihang
Copy link

Also there is another error at Image Classification with TensorFlow Hub.

In the last code block, the document says the object in the given image is blowing glass but actually it is a leatherback turtle.

image

I manually ran the notebook, the result shows as follows.

image

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

Successfully merging this pull request may close these issues.

6 participants