Why is Keras complaining about incompatible input shape in this case?

I have trained a Keras-based autoencoder model with the following input layer: depth = 1 width = height = 100 input_shape = (height, width, depth) inputs = Input(shape=input_shape) # rest of network …

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 …

LSTM neural network test to predict SPY prices giving me this error after training

Error is as follows: Traceback (most recent call last): File “/Users/myname/PycharmProjects/LSTM1P/venv/lib/python3.7/site-packages/pandas/core/indexes/base.py”, line 3080, in get_loc …

TensorFlow CNN Incompatible Shapes: 4D input shape

I have sample data in the form: Data[n][31][31][5][2] with: “[n]” being the sample “[31][31]” being the array of data points “[5]” being the number of bits within that …

Non-zero binary accuracy but 0 accuracy in Keras classifer

I’m trying to train an LSTM classifier in TensorFlow. Here is a reproducible example targets = np.array([1, 0, 1, 1, 0, 0]) features = np.arange(6, 2, 1) model = tf.keras.Sequential([ tf.keras….

shape of an output tensor after convolutional filter on a colour image

I find it difficult to understand a notion about tensors. For VGG (https://www.tensorflow.org/api_docs/python/tf/keras/applications/VGG16), we start from a batch of colour images (none,224,224,3) and …

Keras model.evaluate accuracy stuck at 50 percent while using ImageDataGenerator

I am trying to find the accuracy of my saved Keras model using model.evaluate. I have loaded in my model using this: model = keras.models.load_model(“../input/modelpred/…

How to add code lines when calling a function depending on an iterator on Python

I am trying to test many ML models using keras.models.Sequential. My idea is that once I have an iterator that looks like [num_layers, num_units_per_layers], for example [(1, 64),(2, (64,128))], to …

Adaptive Threshold error: (-215:Assertion failed) src.type() == CV_8UC1 in function ‘adaptiveThreshold’

I am working on pre-trained vgg16 model, for that I need to have input size of image file to be (224,224,3). The code I am working on is: from tensorflow.keras.preprocessing import image import cv2 …

Tensorflow dataset from numpy array

I have two numpy Arrays (X, Y) which I want to convert to a tensorflow dataset. According to the documentation it should be possible to run train_dataset = tf.data.Dataset.from_tensor_slices((X, Y)) …