mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
Replace HDF5 with TF format
This commit is contained in:
@@ -2055,7 +2055,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"model.save(\"my_keras_model\")"
|
||||
"model.save(\"my_keras_model\", save_format=\"tf\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -3678,7 +3678,7 @@
|
||||
],
|
||||
"source": [
|
||||
"early_stopping_cb = tf.keras.callbacks.EarlyStopping(patience=20)\n",
|
||||
"checkpoint_cb = tf.keras.callbacks.ModelCheckpoint(\"my_mnist_model.h5\", save_best_only=True)\n",
|
||||
"checkpoint_cb = tf.keras.callbacks.ModelCheckpoint(\"my_mnist_model\", save_best_only=True)\n",
|
||||
"tensorboard_cb = tf.keras.callbacks.TensorBoard(run_logdir)\n",
|
||||
"\n",
|
||||
"history = model.fit(X_train, y_train, epochs=100,\n",
|
||||
@@ -3710,7 +3710,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"model = tf.keras.models.load_model(\"my_mnist_model.h5\") # rollback to best model\n",
|
||||
"model = tf.keras.models.load_model(\"my_mnist_model\") # rollback to best model\n",
|
||||
"model.evaluate(X_test, y_test)"
|
||||
]
|
||||
},
|
||||
@@ -3781,7 +3781,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.12"
|
||||
"version": "3.9.10"
|
||||
},
|
||||
"nav_menu": {
|
||||
"height": "264px",
|
||||
|
||||
Reference in New Issue
Block a user