'Binary image classification TypeError: Invalid keyword argument(s) in `compile()`

model.compile(
optimizer= keras.optimizers.Adam(), 
loss= [keras.losses.SparseCategoricalCrossentropy(from_logits= True)
      ], 
metrices= ['accuracy'])

model.fit(ds_train, epochs= 10, verbose=2)

TypeError: Invalid keyword argument(s) in compile(): ({'metrices'},). Valid keyword arguments include "cloning", "experimental_run_tf_function", "distribute", "target_tensors", or "sample_weight_mode".



Solution 1:[1]

check your spelling.. its "metrics" ..

model.compile(
optimizer= keras.optimizers.Adam(), 
loss= keras.losses.SparseCategoricalCrossentropy(from_logits= True), 
metrices= ['accuracy'])

model.fit(ds_train, epochs= 10, verbose=2)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Light