Skip to content

Commit f7336cb

Browse files
adammichaelwoodTensorflow Cloud maintainers
authored andcommitted
Makes superfluous output cells nicer.
PiperOrigin-RevId: 374644614
1 parent 006de16 commit f7336cb

5 files changed

+155
-147
lines changed

g3doc/tutorials/distributed_training_nasnet_with_tensorflow_cloud.ipynb

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,6 @@
3131
"# limitations under the License."
3232
]
3333
},
34-
{
35-
"cell_type": "code",
36-
"execution_count": null,
37-
"metadata": {
38-
"id": "4FIdRGBH_gMj"
39-
},
40-
"outputs": [
41-
{
42-
"name": "stdout",
43-
"output_type": "stream",
44-
"text": [
45-
"3.6.13\n"
46-
]
47-
}
48-
],
49-
"source": [
50-
"import platform\n",
51-
"print(platform.python_version())"
52-
]
53-
},
5434
{
5535
"cell_type": "markdown",
5636
"metadata": {
@@ -91,6 +71,34 @@
9171
"## Import required modules"
9272
]
9373
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": null,
77+
"metadata": {
78+
"id": "Kw7YV8nN0gEb"
79+
},
80+
"outputs": [
81+
{
82+
"data": {
83+
"application/vnd.google.colaboratory.intrinsic+json": {
84+
"type": "string"
85+
},
86+
"text/plain": [
87+
"'2.6.0'"
88+
]
89+
},
90+
"execution_count": 1,
91+
"metadata": {
92+
"tags": []
93+
},
94+
"output_type": "execute_result"
95+
}
96+
],
97+
"source": [
98+
"import tensorflow as tf\n",
99+
"tf.version.VERSION"
100+
]
101+
},
94102
{
95103
"cell_type": "code",
96104
"execution_count": null,
@@ -99,18 +107,21 @@
99107
},
100108
"outputs": [],
101109
"source": [
102-
"import os\n",
103-
"import sys\n",
104-
"import tensorflow as tf\n",
105-
"import subprocess\n",
106-
"\n",
107-
"# Install latest version of tensorflow_cloud\n",
108-
"if os.environ.get(\"TF_KERAS_RUNNING_REMOTELY\", True):\n",
109-
" subprocess.run(\n",
110-
" ['python3', '-m', 'pip', 'install', 'tensorflow-cloud', '-q'])\n",
110+
"! pip install -q tensorflow-cloud\n",
111111
"\n",
112112
"import tensorflow_cloud as tfc\n",
113-
"print(tfc.__version__)"
113+
"tfc.__version__"
114+
]
115+
},
116+
{
117+
"cell_type": "code",
118+
"execution_count": null,
119+
"metadata": {
120+
"id": "DjY-m05B4PMC"
121+
},
122+
"outputs": [],
123+
"source": [
124+
"import sys"
114125
]
115126
},
116127
{
@@ -359,7 +370,7 @@
359370
"# If you are using a custom image you can install modules via requirements\n",
360371
"# txt file.\n",
361372
"with open('requirements.txt','w') as f:\n",
362-
" f.write('tensorflow-cloud==0.1.12\\n')\n",
373+
" f.write('tensorflow-cloud\\n')\n",
363374
"\n",
364375
"# Optional: Some recommended base images. If you provide none the system\n",
365376
"# will choose one for you.\n",
@@ -435,7 +446,9 @@
435446
],
436447
"metadata": {
437448
"colab": {
438-
"collapsed_sections": [],
449+
"collapsed_sections": [
450+
"cIG5d4Kvls6m"
451+
],
439452
"name": "distributed_training_nasnet_with_tensorflow_cloud.ipynb",
440453
"toc_visible": true
441454
},

g3doc/tutorials/google_cloud_project_setup_instructions.ipynb

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,6 @@
3131
"# limitations under the License."
3232
]
3333
},
34-
{
35-
"cell_type": "code",
36-
"execution_count": null,
37-
"metadata": {
38-
"id": "4FIdRGBH_gMj",
39-
"outputId": "1c976348-a4d1-48da-9f65-6b7a471aa15b"
40-
},
41-
"outputs": [
42-
{
43-
"name": "stdout",
44-
"output_type": "stream",
45-
"text": [
46-
"3.6.13\n"
47-
]
48-
}
49-
],
50-
"source": [
51-
"import platform\n",
52-
"print(platform.python_version())"
53-
]
54-
},
5534
{
5635
"cell_type": "markdown",
5736
"metadata": {
@@ -99,11 +78,19 @@
9978
},
10079
{
10180
"cell_type": "code",
102-
"execution_count": null,
81+
"execution_count": 1,
10382
"metadata": {
10483
"id": "WPew3GoCcdtm"
10584
},
106-
"outputs": [],
85+
"outputs": [
86+
{
87+
"name": "stdout",
88+
"output_type": "stream",
89+
"text": [
90+
" \n"
91+
]
92+
}
93+
],
10794
"source": [
10895
"GCP_PROJECT_ID = 'YOUR_PROJECT_ID'\n",
10996
"PROJECT_NUMBER = 'YOUR_PROJECT_NUMBER'"
@@ -344,11 +331,8 @@
344331
],
345332
"metadata": {
346333
"colab": {
347-
"collapsed_sections": [
348-
"3t3TAdQCmX9o"
349-
],
334+
"collapsed_sections": [],
350335
"name": "google_cloud_project_setup_instructions.ipynb",
351-
"provenance": [],
352336
"toc_visible": true
353337
},
354338
"kernelspec": {

g3doc/tutorials/hp_tuning_cifar10_using_google_cloud.ipynb

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,6 @@
3131
"# limitations under the License."
3232
]
3333
},
34-
{
35-
"cell_type": "code",
36-
"execution_count": null,
37-
"metadata": {
38-
"id": "4FIdRGBH_gMj",
39-
"outputId": "d8b84ada-47f7-4436-efe5-6a672f923c04"
40-
},
41-
"outputs": [
42-
{
43-
"name": "stdout",
44-
"output_type": "stream",
45-
"text": [
46-
"3.6.13\n"
47-
]
48-
}
49-
],
50-
"source": [
51-
"import platform\n",
52-
"print(platform.python_version())"
53-
]
54-
},
5534
{
5635
"cell_type": "markdown",
5736
"metadata": {
@@ -114,13 +93,36 @@
11493
"from tensorflow.keras import datasets, layers, models\n",
11594
"from sklearn.model_selection import train_test_split\n",
11695
"\n",
117-
"# Install latest version of tensorflow_cloud\n",
118-
"if os.environ.get(\"TF_KERAS_RUNNING_REMOTELY\", True):\n",
119-
" subprocess.run(\n",
120-
" ['python3', '-m', 'pip', 'install', 'tensorflow-cloud', '-q'])\n",
12196
"\n",
122-
"import tensorflow_cloud as tfc\n",
123-
"print(tfc.__version__)"
97+
"! pip install -q tensorflow-cloud\n",
98+
"import tensorflow_cloud as tfc"
99+
]
100+
},
101+
{
102+
"cell_type": "code",
103+
"execution_count": null,
104+
"metadata": {
105+
"id": "BnUf9-AA_pZ_"
106+
},
107+
"outputs": [
108+
{
109+
"data": {
110+
"application/vnd.google.colaboratory.intrinsic+json": {
111+
"type": "string"
112+
},
113+
"text/plain": [
114+
"'2.6.0'"
115+
]
116+
},
117+
"execution_count": 1,
118+
"metadata": {
119+
"tags": []
120+
},
121+
"output_type": "execute_result"
122+
}
123+
],
124+
"source": [
125+
"tf.version.VERSION"
124126
]
125127
},
126128
{
@@ -479,7 +481,6 @@
479481
"2ej8rnJkmoA8"
480482
],
481483
"name": "hp_tuning_cifar10_using_google_cloud.ipynb",
482-
"provenance": [],
483484
"toc_visible": true
484485
},
485486
"kernelspec": {

g3doc/tutorials/hp_tuning_wide_and_deep_model.ipynb

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": 1,
14+
"execution_count": null,
1515
"metadata": {
1616
"cellView": "form",
1717
"id": "d60Uw7pfm88w"
@@ -31,26 +31,6 @@
3131
"# limitations under the License."
3232
]
3333
},
34-
{
35-
"cell_type": "code",
36-
"execution_count": 2,
37-
"metadata": {
38-
"id": "4FIdRGBH_gMj"
39-
},
40-
"outputs": [
41-
{
42-
"name": "stdout",
43-
"output_type": "stream",
44-
"text": [
45-
"3.6.13\n"
46-
]
47-
}
48-
],
49-
"source": [
50-
"import platform\n",
51-
"print(platform.python_version())"
52-
]
53-
},
5434
{
5535
"cell_type": "markdown",
5636
"metadata": {
@@ -128,6 +108,33 @@
128108
"print(tfc.__version__)"
129109
]
130110
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": null,
114+
"metadata": {
115+
"id": "jsvQ6ZjzArYS"
116+
},
117+
"outputs": [
118+
{
119+
"data": {
120+
"application/vnd.google.colaboratory.intrinsic+json": {
121+
"type": "string"
122+
},
123+
"text/plain": [
124+
"'2.6.0'"
125+
]
126+
},
127+
"execution_count": 2,
128+
"metadata": {
129+
"tags": []
130+
},
131+
"output_type": "execute_result"
132+
}
133+
],
134+
"source": [
135+
"tf.version.VERSION"
136+
]
137+
},
131138
{
132139
"cell_type": "markdown",
133140
"metadata": {

0 commit comments

Comments
 (0)