"\u001b[0;32m~/venv3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py\u001b[0m in \u001b[0;36menable_eager_execution_internal\u001b[0;34m(config, device_policy, execution_mode, server_def)\u001b[0m\n\u001b[1;32m 5306\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5307\u001b[0m raise ValueError(\n\u001b[0;32m-> 5308\u001b[0;31m \"tf.enable_eager_execution must be called at program startup.\")\n\u001b[0m\u001b[1;32m 5309\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5310\u001b[0m \u001b[0;31m# Monkey patch to get rid of an unnecessary conditional since the context is\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: tf.enable_eager_execution must be called at program startup."
]
}
],
"source": [
"source": [
"import tensorflow as tf\n",
"import tensorflow as tf\n",
"import tensorflow.feature_column as fc \n",
"import tensorflow.feature_column as fc \n",
...
@@ -51,29 +69,32 @@
...
@@ -51,29 +69,32 @@
"import os\n",
"import os\n",
"import sys\n",
"import sys\n",
"from IPython.display import clear_output"
"from IPython.display import clear_output"
]
],
"execution_count": 1,
"outputs": []
},
},
{
{
"metadata": {
"id": "-MPr95UccYvL",
"colab_type": "text"
},
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"source": [
"source": [
"Download the [tutorial code from github](https://github.com/tensorflow/models/tree/master/official/wide_deep/),\n",
"Download the [tutorial code from github](https://github.com/tensorflow/models/tree/master/official/wide_deep/),\n",
" add the root directory to your python path, and jump to the `wide_deep` directory:"
" add the root directory to your python path, and jump to the `wide_deep` directory:"
"Because `Estimators` expect an `input_fn` that takes no arguments, we typically wrap configurable input function into an obejct with the expected signature. For this notebook configure the `train_inpf` to iterate over the data twice:"
"Because `Estimators` expect an `input_fn` that takes no arguments, we typically wrap configurable input function into an obejct with the expected signature. For this notebook configure the `train_inpf` to iterate over the data twice:"
"These crossed columns always use hash buckets to avoid the exponential explosion in the number of categories, and put the control over number of model weights in the hands of the user.\n",
"These crossed columns always use hash buckets to avoid the exponential explosion in the number of categories, and put the control over number of model weights in the hands of the user.\n",
"\n",
"\n",
...
@@ -1190,8 +1561,11 @@
...
@@ -1190,8 +1561,11 @@
]
]
},
},
{
{
"metadata": {
"id": "HtjpheB6cYw9",
"colab_type": "text"
},
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"source": [
"source": [
"## Defining The Logistic Regression Model\n",
"## Defining The Logistic Regression Model\n",
"\n",
"\n",
...
@@ -1210,39 +1584,16 @@
...
@@ -1210,39 +1584,16 @@
]
]
},
},
{
{
"cell_type": "code",
"metadata": {
"execution_count": 36,
"id": "Klmf3OxpcYw-",
"metadata": {},
"colab_type": "code",
"outputs": [
"colab": {
{
"base_uri": "https://localhost:8080/",
"name": "stdout",
"height": 105
"output_type": "stream",
"text": [
"INFO:tensorflow:Using default config.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"I0711 14:48:54.071429 140466218788608 tf_logging.py:115] Using default config.\n"