Perhaps I am misunderstanding something, but I feel like this code should work
Minimal code example
import tensorflow as tf
from keras.layers import Input, Conv2D, Flatten
tf.reset_default_graph()
D = (80,80,6)
input_x = Input(shape=D, name='input_x')
conv1 = Conv2D(filters=16, kernel_size=(7,7), strides=(3,3), activation='relu')
flatten = Flatten()(conv1)
However i get the error AttributeError: 'Conv2D' object has no attribute 'get_shape'
My setup
Really bad mistake on my part. I forgot to give conv1 an argument.
For the record: Replace
conv1 = Conv2D(filters=16, kernel_size=(7,7), strides=(3,3), activation='relu')
with
conv1 = Conv2D(filters=16, kernel_size=(7,7), strides=(3,3), activation='relu')(input_x)
Most helpful comment
Really bad mistake on my part. I forgot to give
conv1an argument.For the record: Replace
conv1 = Conv2D(filters=16, kernel_size=(7,7), strides=(3,3), activation='relu')with
conv1 = Conv2D(filters=16, kernel_size=(7,7), strides=(3,3), activation='relu')(input_x)