I am getting the error below when trying to create the object from vgg16(). I seems that Flatten() is not well defined but I saw that in all examples in source code, Flatten class has no declared argument. How to fix this issue?
----> 1 vgg = Vgg16()
Lesson1\vgg16.py in init(self, size, include_top)
31 def init(self, size=(224,224), include_top=True):
32 self.FILE_PATH = ‘http://www.platform.ai/models/’
—> 33 self.create(size, include_top)
34 self.get_classes()
35
C:\Users\carlao\Deep-Learning\Lesson1\vgg16.py in create(self, size, include_top)
83 return
84
—> 85 model.add(Flatten())
86 self.FCBlock()
87 self.FCBlock()
c:\users\carlao\anaconda2\lib\site-packages\keras\keras\models.pyc in add(self, layer)
329 output_shapes=[self.outputs[0]._keras_shape])
330 else:
–> 331 output_tensor = layer(self.outputs[0])
332 if isinstance(output_tensor, list):
333 raise TypeError('All layers in a Sequential model ’
c:\users\carlao\anaconda2\lib\site-packages\keras\keras\engine\topology.pyc in call(self, x, mask)
567 if inbound_layers:
568 # This will call layer.build() if necessary.
–> 569 self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
570 # Outputs were already computed when calling self.add_inbound_node.
571 outputs = self.inbound_nodes[-1].output_tensors
c:\users\carlao\anaconda2\lib\site-packages\keras\keras\engine\topology.pyc in add_inbound_node(self, inbound_layers, node_indices, tensor_indices)
630 # creating the node automatically updates self.inbound_nodes
631 # as well as outbound_nodes on inbound layers.
–> 632 Node.create_node(self, inbound_layers, node_indices, tensor_indices)
633
634 def get_output_shape_for(self, input_shape):
c:\users\carlao\anaconda2\lib\site-packages\keras\keras\engine\topology.pyc in create_node(cls, outbound_layer, inbound_layers, node_indices, tensor_indices)
166 # TODO: try to auto-infer shape
167 # if exception is raised by get_output_shape_for.
–> 168 output_shapes = to_list(outbound_layer.get_output_shape_for(input_shapes[0]))
169 else:
170 output_tensors = to_list(outbound_layer.call(input_tensors, mask=input_masks))
c:\users\carlao\anaconda2\lib\site-packages\keras\keras\layers\core.pyc in get_output_shape_for(self, input_shape)
434 raise ValueError('The shape of the input to “Flatten” '
435 'is not fully defined '
–> 436 '(got ’ + str(input_shape[1:]) + '. '
437 'Make sure to pass a complete “input_shape” '
438 'or “batch_input_shape” argument to the first ’
ValueError: The shape of the input to “Flatten” is not fully defined (got (0, 7, 512). Make sure to pass a complete “input_shape” or “batch_input_shape” argument to the first layer in your model.