Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrong x-axis label order #2212

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

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

Wrong x-axis label order #2212

FrankXu1 wants to merge 3 commits into tensorflow:master from FrankXu1:master

Conversation

Copy link

@FrankXu1 FrankXu1 commented Mar 29, 2023

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
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.

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

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.

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.

WangYihang reacted with thumbs up emoji
@@ -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).

WangYihang reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Reviewers

@8bitmp3 8bitmp3 8bitmp3 left review comments

@markmcd markmcd markmcd requested changes

Requested changes must be addressed to merge this pull request.

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /