tensorflow TypeError: cannot unpack non-iterable float object

Viewed 4497

I am using tensorflow V2.2 and run into TyepError when I do model.evaluate. Can someone advise what the issues may be? A screenshot of the execution and error message is shown below. enter image description here

2 Answers

you need to define a metric when you compile the model model.compile('adam', 'binary_crossentropy', metrics='accuracy')

in this way during evaluation, loss and accuracy are returned

Actually, if you don't have metric='accuracy' in the model.compile, don't try to extract it in model.evaluate.

So, you can change:

loss, acc= model.evaluate(df, df_y, verbose=0)

to

loss = model.evaluate(df, df_y, verbose=0)

Related