You need to follow and understand some basic examples e.g. with MNIST and then reproduce it  for your dataset.
For a complete basic example see:

  

      PyImageSearch – 30 Mar 20
  

  
    

Autoencoders for Content-based Image Retrieval with Keras and TensorFlow -... 1

  Learn how to use convolutional autoencoders to create a Content-based Image Retrieval system (i.e., image search engine) using Keras and TensorFlow.

  
    Est. reading time: 25 minutes