Try with mode w
diff --git a/tensorflow/python/keras/saving/save_test.py b/tensorflow/python/keras/saving/save_test.py
index 3ebad7c..a3a93f4 100644
--- a/tensorflow/python/keras/saving/save_test.py
+++ b/tensorflow/python/keras/saving/save_test.py
@@ -677,7 +677,7 @@
self.assertAllClose(out, out2, atol=1e-05)
# Test non-default options in h5
- with h5py.File('_', driver='core',
+ with h5py.File('_', driver='core', mode='w',
backing_store=False) as h5file:
keras.models.save_model(model, h5file)
loaded_model = keras.models.load_model(h5file)