Work around "import tensorflow.train" bug.

main
Aurélien Geron 2019-10-12 17:38:40 +09:30
parent 02205e034f
commit 5c9957065b
1 changed files with 11 additions and 3 deletions

View File

@ -889,8 +889,16 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"from tensorflow.train import BytesList, FloatList, Int64List\n", "# WARNING: there's currently a bug preventing \"from tensorflow.train\"\n",
"from tensorflow.train import Feature, Features, Example\n", "# so we work around it by writing \"X = tf.train.X\"\n",
"#from tensorflow.train import BytesList, FloatList, Int64List\n",
"#from tensorflow.train import Feature, Features, Example\n",
"BytesList = tf.train.BytesList\n",
"FloatList = tf.train.FloatList\n",
"Int64List = tf.train.Int64List\n",
"Feature = tf.train.Feature\n",
"Features = tf.train.Features\n",
"Example = tf.train.Example\n",
"\n", "\n",
"person_example = Example(\n", "person_example = Example(\n",
" features=Features(\n", " features=Features(\n",
@ -1724,7 +1732,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.8" "version": "3.7.4"
}, },
"nav_menu": { "nav_menu": {
"height": "264px", "height": "264px",