You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Epoch 1/25
WARNING:tensorflow:Model was constructed with shape (None, 18729, 2, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 18729, 2, 1), dtype=tf.float32, name='conv2d_16_input'), name='conv2d_16_input', description="created by layer 'conv2d_16_input'"), but it was called on an input with incompatible shape (None, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).
The given below is the error I've got.
Epoch 1/25
WARNING:tensorflow:Model was constructed with shape (None, 18729, 2, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 18729, 2, 1), dtype=tf.float32, name='conv2d_16_input'), name='conv2d_16_input', description="created by layer 'conv2d_16_input'"), but it was called on an input with incompatible shape (None, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).
ValueError Traceback (most recent call last)
in ()
5 from keras.utils import to_categorical
6
----> 7 history=model.fit(X_train_scaled,Y_train_scaled,epochs=25,validation_data=(X_train_scaled,Y_train_scaled))
8 #history=model.fit(X_train_scaled,Y_train_scaled,batch_size=32,epochs=100,verbose=2,validation_split=0.8)
9 print(model.summary())
9 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
975 except Exception as e: # pylint:disable=broad-except
976 if hasattr(e, "ag_error_metadata"):
--> 977 raise e.ag_error_metadata.to_exception(e)
978 else:
979 raise
ValueError: in user code:
The code is this:
%tensorflow_version 2.3
import tensorflow as tf
X_Train = X_train_scaled.reshape(X_train.shape + (-1,))
print(X_Train.shape) # (8000,20,32,1)
Y_Train = Y_train_scaled.reshape( Y_train.shape+ (-1,))
print(Y_Train.shape) # (8000,20,32,1)
model = tf.keras.models.Sequential([ tf.keras.layers.Conv2D(1, (18729,2), input_shape=(18729,2,1))])
model.compile(loss='mse', optimizer='rmsprop',metrics=['accuracy'])
print ('compilation time : ', time.time() - start)
The text was updated successfully, but these errors were encountered: