今天调用TensorFlow框架中的softmax_cross_entropy_with_logits()方法时,报了如下的错误:

ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

这个函数现在不能按照以前的方式调用了,以前的调用方式如下:

cost_sme = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits, labels))

使用新的调用方式,如下:

cost_sme = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=labels))

 

相关文章:

  • 2022-03-06
  • 2021-08-25
  • 2021-12-28
  • 2022-12-23
  • 2022-02-09
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2022-01-23
  • 2021-07-17
  • 2021-08-29
相关资源
相似解决方案