小编Fut*_*ure的帖子

'float' 对象没有属性 'round'

我有一个代码如下所示:

history['test_acc'].append(results.history['val_dense_5_accuracy'][0]) 
Run Code Online (Sandbox Code Playgroud)

然后我想打印如下:

 print('Epoch: '+str(epoch)+'/'+str(epochs-1), 'Learning rate:', 
      'Test_acc:', history['test_acc'][-1].round(4),
      'Test_loss:', history['test_loss'][-1].round(4))`
Run Code Online (Sandbox Code Playgroud)

但在这一行:

'Test_acc:', history['test_acc'][-1].round(4)
Run Code Online (Sandbox Code Playgroud)

我有这个错误:'float' 对象没有属性 'round' 有什么问题?

python keras

6
推荐指数
1
解决办法
5959
查看次数

标签 统计

keras ×1

python ×1