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

Commit 664aa47

Browse files
Merge pull request #2387 from chicco-carone:fix-classification-download
PiperOrigin-RevId: 778332905
2 parents 1a48d77 + 52ebb5b commit 664aa47

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎site/en/tutorials/images/classification.ipynb‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@
153153
"import pathlib\n",
154154
"\n",
155155
"dataset_url = \"https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz\"\n",
156-
"data_dir = tf.keras.utils.get_file('flower_photos.tar', origin=dataset_url, extract=True)\n",
157-
"data_dir = pathlib.Path(data_dir).with_suffix('')"
156+
"data_dir = tf.keras.utils.get_file(\"flower_photos.tgz\", origin=dataset_url, extract=True)\n",
157+
"data_dir = pathlib.Path(data_dir).parent / \"flower_photos_extracted\" / \"flower_photos\""
158158
]
159159
},
160160
{
@@ -1088,7 +1088,8 @@
10881088
"outputs": [],
10891089
"source": [
10901090
"classify_lite = interpreter.get_signature_runner('serving_default')\n",
1091-
"classify_lite"
1091+
"print(classify_lite.get_input_details())\n",
1092+
"print(classify_lite.get_output_details())"
10921093
]
10931094
},
10941095
{
@@ -1110,7 +1111,7 @@
11101111
},
11111112
"outputs": [],
11121113
"source": [
1113-
"predictions_lite = classify_lite(sequential_1_input=img_array)['outputs']\n",
1114+
"predictions_lite = classify_lite(keras_tensor_15=img_array)['output_0']\n",
11141115
"score_lite = tf.nn.softmax(predictions_lite)"
11151116
]
11161117
},
@@ -1176,7 +1177,7 @@
11761177
"colab": {
11771178
"collapsed_sections": [],
11781179
"name": "classification.ipynb",
1179-
"toc_visible": true
1180+
"toc_visible": true
11801181
},
11811182
"kernelspec": {
11821183
"display_name": "Python 3",

0 commit comments

Comments
(0)

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