Skip to content

Commit ecff466

Browse files
committed
minor fix to keras optimization notebook
1 parent 3c12999 commit ecff466

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

00_Miscellaneous/model_optimisation/Tutorial - TensorFlow Model Optimisation for Serving - MNIST with Keras.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@
396396
"if tf.gfile.Exists(model_dir):\n",
397397
" print(\"Removing previous artifacts...\")\n",
398398
" tf.gfile.DeleteRecursively(model_dir)\n",
399-
" \n",
399+
"\n",
400+
"os.makedirs(model_dir)\n",
401+
"\n",
400402
"estimator = run_experiment(params, run_config)"
401403
]
402404
},
@@ -586,7 +588,8 @@
586588
}
587589
],
588590
"source": [
589-
"saved_model_dir = os.path.join(export_dir, os.listdir(export_dir)[-1]) \n",
591+
"saved_model_dir = os.path.join(\n",
592+
" export_dir, [f for f in os.listdir(export_dir) if f.isdigit()][0])\n",
590593
"print(saved_model_dir)\n",
591594
"inference_test(saved_model_dir)"
592595
]

0 commit comments

Comments
 (0)