-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
base: master
Are you sure you want to change the base?
Wrong x-axis label order #2212
Conversation
Wrong order correction
Correction the order-final
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. |
PreviewPreview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.Format and styleUse 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/docsIf commits are added to the pull request, synchronize your local branch: git pull origin master
|
I agreed to @FrankXu1. 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. |
This looks good to me |
There was a problem hiding this 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 I manually ran the notebook, the result shows as follows. |
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.