【问题标题】:tf.boolean_mask not accepting the axis argumenttf.boolean_mask 不接受轴参数
【发布时间】:2023-04-03 03:17:01
【问题描述】:

这是我的代码:

 44     scores = tf.boolean_mask(box_class_scores,filtering_mask,axis=-1)
 45     boxes = tf.boolean_mask(boxes,filtering_mask,axis=-1)
 46     classes = tf.boolean_mask(box_classes,filtering_mask,axis=-1)

错误,我得到:

TypeError: boolean_mask() 得到了一个意外的关键字参数“轴”

tf.boolean_mask() 不接受轴参数,但可以在文档中看到有效参数:https://www.tensorflow.org/api_docs/python/tf/boolean_mask

【问题讨论】:

  • 您可能想检查您的 tensorflow 版本是否与您正在查看的文档匹配
  • @SUSHANTH TIWARY 你在做深度学习专业课程吗?我从 2 天开始就面临同样的问题。请帮我解决这个问题

标签: python tensorflow keras yolo


【解决方案1】:

如果您从函数中删除 axis 参数,它将起作用。您遇到的错误将得到解决。

【讨论】:

    【解决方案2】:

    正如@syltruong 所指出的,检查您使用的 Keras 版本是否与文档匹配。目前,文档使用版本 2.2.4。

    附带说明@Ganesh 和@Sushant,您实际上不需要为深度学习专业化中的特定代码使用轴参数。

    【讨论】:

      猜你喜欢
      • 2018-02-03
      • 1970-01-01
      • 2022-06-16
      • 2016-10-31
      • 2018-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多