title: module 'h5py' has no attribute 'File' when trying to save a tensorflow model
body: <p>So I Just made a small NN with the MNIST Digit Database and I'm trying to save it. Here is the full code:</p>
  <pre><code># Importing Libs
  import h5py
  import tensorflow as tf
  import numpy as np
  import matplotlib.pyplot as plt
  from tensorflow import keras
  
  # ---------- PART I: Importing and cleaning Data ----------
  # Importing Data
  train_data = np.genfromtxt('mnist_train.csv', delimiter=',')[1:]
  test_data  = np.genfromtxt('mnist_test.csv', delimiter=',')[1:]
  
  train_images = train_data[:, 1:]
  train_labels = train_data[:, 0]
  
  test_images  = test_data[:, 1:]
  test_labels  = test_data[:, 0]
  
  class_names = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  
  train_images = train_images/255
  test_images = test_images/255
  
  train_images = train_images.reshape(60000, 28, 28)
  test_images = test_images.reshape(10000, 28, 28)
  
  # ---------- PART II: Making the model ----------
  layers = [keras.layers.Flatten(input_shape=(28, 28)), 
            keras.layers.Dense(128, activation='relu'), 
            keras.layers.Dense(10, activation='softmax')]
  
  model = keras.Sequential(layers)
  model.compile(optimizer='adam', 
                loss='sparse_categorical_crossentropy', 
                metrics=['accuracy'])
  
  
  model.fit(train_images, train_labels, epochs=1
  model.save(&quot;network.h5&quot;)
  </code></pre>
  <p>And here is the traceback:</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-36-0e5ebf05c427&gt; in &lt;module&gt;
        1 print('Saving Model...')
  ----&gt; 2 model.save(&quot;network.h5&quot;)
  
  ~\Downloads\Anaconda\lib\site-packages\tensorflow_core\python\keras\engine\network.py in save(self, filepath, overwrite, include_optimizer, save_format, signatures, options)
     1006     &quot;&quot;&quot;
     1007     save.save_model(self, filepath, overwrite, include_optimizer, save_format,
  -&gt; 1008                     signatures, options)
     1009 
     1010   def save_weights(self, filepath, overwrite=True, save_format=None):
  
  ~\Downloads\Anaconda\lib\site-packages\tensorflow_core\python\keras\saving\save.py in save_model(model, filepath, overwrite, include_optimizer, save_format, signatures, options)
       97 
       98   if (save_format == 'h5' or
  ---&gt; 99       (h5py is not None and isinstance(filepath, h5py.File)) or
      100       os.path.splitext(filepath)[1] in _HDF5_EXTENSIONS):
      101     # TODO(b/130258301): add utility method for detecting model type.
  
  AttributeError: module 'h5py' has no attribute 'File'
  </code></pre>
  <p>My versions:</p>
  <ol>
  <li>tensorflow: 2.1.0</li>
  <li>keras: 2.2.4-tf</li>
  <li>h5py: 2.10.0</li>
  <li>Anaconda: 2019.10</li>
  </ol>
  <p>Any help would be greatly appreciated.</p>