KeyError: 'acc'

简介: KeyError: 'acc'

在使用TensorFlow2.0以上的版本,读取历史acc时出现这个问题,需要将acc改为accuracy,将val_acc


改为val_accuracy


train_loss = history.history['loss'][0]

train_acc = history.history['accuracy'][0]

val_loss = history.history['val_loss'][0]

val_acc = history.history['val_accuracy'][0]


目录
相关文章
|
4月前
|
安全 Python
ValueError 问题
ValueError 问题
48 1
|
4月前
|
Python
完美解决丨2. `TypeError: list indices must be integers or slices, not str`
完美解决丨2. `TypeError: list indices must be integers or slices, not str`
dict中所有方法的使用
提示:以下是本篇文章正文内容,下面案例可供参考
49 0
|
机器学习/深度学习 算法框架/工具
【问题记录与解决】KeyError: ‘acc‘ plt.plot(N[150:], H.history[“acc“][150:], label=“train_acc“) # KeyError: ‘
【问题记录与解决】KeyError: ‘acc‘ plt.plot(N[150:], H.history[“acc“][150:], label=“train_acc“) # KeyError: ‘
【问题记录与解决】KeyError: ‘acc‘ plt.plot(N[150:], H.history[“acc“][150:], label=“train_acc“) # KeyError: ‘
AttributeError: ‘list‘ object has no attribute ‘ndim‘
AttributeError: ‘list‘ object has no attribute ‘ndim‘
176 0
|
Python
解决ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following
解决ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following
617 0
解决ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following
|
Python
AttributeError: 'list' object has no attribute 'ndim'
AttributeError: 'list' object has no attribute 'ndim'
526 0
TypeError: tuple indices must be integers, not tuple是怎么回事
TypeError: tuple indices must be integers, not tuple是怎么回事
251 0
TypeError: cannot concatenate ‘str‘ and ‘list‘ objects
TypeError: cannot concatenate ‘str‘ and ‘list‘ objects
|
Linux Python
ValueError: empty range for randrange() (0, 0, 0)
ValueError: empty range for randrange() (0, 0, 0)