I encountered this error in a basic CNN:
AttributeError: \'SparseCategoricalCrossentropy\' object has no attribute \'name\'