Closed naveennnair closed 6 years ago
@naveennnair It looks like the model's expecting a value that isn't given. Have you checked the shape of X_train before training the model? Granted, the output is printed when reshaped, but is anything done on your end that may reshape the array without you knowing?
Also noticed you posted my code here: https://stackoverflow.com/questions/49505319/layer-conv2d-37-was-called-with-an-input-that-isnt-a-symbolic-tensor
In the comments, you mention X_train has a shape of (233,256,256,3). In the open issue, the shape of X_train is (422, 256, 256, 3); think that would have something to do with your issue?
@naveennnair What System are you running the Code with?I mean System Configuration?
@gregwchase My X_train is size is the same as you mentioned (422, 256, 256, 3). Also the code Conv2D is working fine for me. I mentioned the code below.
Conv2D(nb_filters, (kernel_size[0], kernel_size[1]), padding='valid', strides=1, input_shape=(img_rows, img_cols, channels), activation="relu")
But if I add the model, then it is showing the following error.
model.add(Conv2D(nb_filters, (kernel_size[0], kernel_size[1]), padding='valid', strides=1, input_shape=(img_rows, img_cols, channels), activation="relu"))
Even when I tried some other sample program also, it's showing me the same error.
classifier = Sequential()
classifier.add(Conv2D(32, (3, 3), input_shape = (64, 64, 3), activation = 'relu'))
Could you please help with this. Thank you.
@dhanasekar416 It's Windows 7 system with 8 GB RAM. Here I'm using keras 2.1.5 and tensorflow 1.2.1
@gregwchase This all are my variable which has been created while executing the code. I have used few images for training the model. Thank you.
cnn.py is showing the value error. while running the main, it showing the following error
Splitting data into test/ train datasets Reshaping Data X_train Shape: (422, 256, 256, 3) X_test Shape: (106, 256, 256, 3) Normalizing Data y_train Shape: (422, 2) y_test Shape: (106, 2) Training Model Traceback (most recent call last):
File "", line 45, in
nb_classes, nb_gpus=8)
File "", line 24, in cnn_model
input_shape=(img_rows, img_cols, channels), activation="relu"))
File "C:\Users\naveenn\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\models.py", line 467, in add layer(x)
File "C:\Users\naveenn\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\engine\topology.py", line 575, in call self.assert_input_compatibility(inputs)
File "C:\Users\naveenn\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\engine\topology.py", line 448, in assert_input_compatibility str(inputs) + '. All inputs to the layer '
ValueError: Layer conv2d_51 was called with an input that isn't a symbolic tensor. Received type: <class 'tensorflow.python.framework.ops.Tensor'>. Full input: [<tf.Tensor 'conv2d_51_input:0' shape=(?, 256, 256, 3) dtype=float32>]. All inputs to the layer should be tensors.