title: how do I load celeba dataset into spyder
body: <p>I downloaded <a href="http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html" rel="nofollow noreferrer">celebA</a> dataset and extracted it to my harddrive.
  it's in a folder structure like below.</p>
  <pre><code> dataset_directory
           +- celeba
              +- img_align_celeba
                 +- 000001.jpg
                 +- 000002.jpg
                 +- 000003.jpg
                 +- ...
  </code></pre>
  <p>I also have the annotation files both in txt and CSV format</p>
  <p>What's the best way to load this as a dataset? The only way I have done before was loading from TensorFlow using something like the code below but this will not work there in this case</p>
  <pre><code>(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
  </code></pre>
  <p>I am hoping to build a model using the function below</p>
  <pre><code>(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
  
  x_train = x_train.reshape(-1,28,28,1)
  x_test = x_test.reshape(-1,28,28,1)
  
  def build_model(hp):   #random search passes this hyperparameter() object
      model = keras.models.Sequential()
      
      
      #model.add(Conv2D(32, (3, 3), input_shape=x_train.shape[1:]))
      model.add(Conv2D(hp.Int(&quot;input_units&quot;, min_value=32, max_value=256, step=32), (3,3), input_shape = x_train.shape[1:]))
      model.add(Activation('relu'))
      model.add(MaxPooling2D(pool_size=(2, 2)))
      
      
      for i in range(hp.Int(&quot;n_layers&quot;,min_value = 1, max_value = 4, step=1)):
          #model.add(Conv2D(32, (3, 3)))                
          model.add(Conv2D(hp.Int(f&quot;conv_{i}_units&quot;, min_value=32, max_value=256, step=32), (3,3)))
          model.add(Activation('relu'))
          #model.add(MaxPooling2D(pool_size=(2, 2)))
      
      model.add(Flatten())  # this converts our 3D feature maps to 1D feature vectors
      
      model.add(Dense(10))
      model.add(Activation(&quot;softmax&quot;))
      
      model.compile(optimizer=&quot;adam&quot;,
                    loss=&quot;sparse_categorical_crossentropy&quot;,
                    metrics=[&quot;accuracy&quot;])
      return model
  </code></pre>
  <p>I would appreciate any help</p>