AttributeError: 'Sequential' object has no attribute 'shape'

Getting error
AttributeError: 'Sequential' object has no attribute 'shape'
After below code
model <- keras_model_sequential()

model %>%
layer_conv_2d(kernel_size = c(3, 3), filter = 32,
activation = "relu",
input_shape = c(50, 50, 3)) %>%
layer_conv_2d(kernel_size = c(3, 3), filter = 32,
activation = "relu",) %>%
layer_max_pooling_2d(pool_size = 2) %>%
layer_dropout(rate = 0.25) %>%
layer_conv_2d(kernel_size = c(3, 3), filter = 64,
activation = "relu") %>%
layer_conv_2d(kernel_size = c(3, 3), filter = 64,
activation = "relu") %>%
layer_max_pooling_2d(pool_size = 2) %>%
layer_dropout(rate = 0.25) %>%
layer_flatten() %>%
layer_dense(units = 50, activation = "relu") %>%
layer_dropout(rate = 0.25) %>%
layer_dense(units = 4, activation = "softmax")%>%

Hello @pankajsingh.cs
How do you install Keras? Did you use The Rtudio doc (https://tensorflow.rstudio.com/keras/). Did you install Keras using the function install_keras? If you install tensorflow and keras by yourself, you need to install additionnal dependencies (see here : https://tensorflow.rstudio.com/tensorflow/articles/installation.html#additional-dependencies)

Hope it help
Rodrigue

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.