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]


目录
相关文章
|
5月前
|
Python
ValueError: sleep length must be non-negative
ValueError: sleep length must be non-negative
140 3
|
9月前
|
索引 Python
circles[0, :]
circles[0, :]“【5月更文挑战第17天】”
48 4
|
9月前
|
Python
完美解决丨2. `TypeError: list indices must be integers or slices, not str`
完美解决丨2. `TypeError: list indices must be integers or slices, not str`
dict中所有方法的使用
提示:以下是本篇文章正文内容,下面案例可供参考
62 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: ‘
|
PyTorch 算法框架/工具 开发者
RuntimeError: Can‘t call numpy() on Variable that requires grad. Use var.detach().numpy()
出现这个现象的原因是:待转换类型的PyTorch Tensor变量带有梯度,直接将其转换为numpy数据将破坏计算图,因此numpy拒绝进行数据转换,实际上这是对开发者的一种提醒。如果自己在转换数据时不需要保留梯度信息,可以在变量转换之前添加detach()调用。
222 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
669 0
解决ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following
|
Python
TypeError: img is not a numpy array, neither a scalar
TypeError: img is not a numpy array, neither a scalar
309 0
TypeError: tuple indices must be integers, not tuple是怎么回事
TypeError: tuple indices must be integers, not tuple是怎么回事
283 0
np.random.choice 参数replace
np.random.choice 参数replace
149 0

热门文章

最新文章