Skip to content
Advertisement

Tag: keras

Reshaping MNIST for ResNet50

I am trying to train the mnist dataset on ResNet50 using the Keras library. The shape of mnist is (28, 28, 1) however resnet50 required the shape to be (32, 32, 3) How can I convert the mnist dataset to the required shape? Answer You need to resize the MNIST data set. Note that minimum size actually depends on the

How to train a Keras autoencoder with custom dataset?

I am reading this tutorial in order to create my own autoencoder based on Keras. I followed the tutorial step by step, the only difference is that I want to train the model using my own images data set. So I changed/added the following code: My images are normal .jpg files in RGB format. However, as soon as training starts

Invalid argument: Dimension -972891 must be >= 0

I have created a data pipeline using tf.data for speech recognition using the following code snippets: These snippets are borrowed from https://www.tensorflow.org/tutorials/audio/simple_audio#build_and_train_the_model. And my model is defined as below: When I start training process this error appears after a few iterations: Answer I have found that the issue happened in the padding step, I mean I’ve replaced the padding step

how to use more three channels input in train_datagen

I am trying to apply Keras for images with more than three spectral channels. I noticed that train_datagen handles images with three channels based on color_mode=’rgb’. Is there any way to increase the number input channels or are there any alternative methods? Answer You can have 1, 3 or 4 channels. See the docs. color_mode One of “grayscale”, “rgb”, “rgba”.

Advertisement