happyModel 'tuple' object has no attribute 'lower'

We can see from the trace that the exception is thrown while examining the attribute data_format. According to the doc, that parameter is supposed to be a string with value either channels_last or channels_first. Instead, you have a Python tuple and tuples don’t implement a function lower, hence the error. NOTE: if data_format is a string, the very next line checks the value, and throws an exception if it isn’t either channels_first or channels_last.

FWIW, that tuple looks suspiciously like an input_shape :thinking:. In the above Conv2D doc look for the part that says When using this layer as the first layer in a model, provide the keyword argument input_shape (tuple of integers…

Or take a quick peek at the Sequential model doc here

and look for the part that starts… A simple alternative is to just pass an input_shape argument to your first layer:

I have now added content covering this to my Tips for troubles with Sequential and Functional API syntax thread

1 Like