keep__smile 2021-05-15 19:01 采纳率: 0%
浏览 319

module 'torch' has no attribute 'softmax'

source_unseen_output = torch.softmax(torch.mm(source_fc8, unseen_vec.t()) * self.entropy_lambda, dim=1) E_loss = (-source_unseen_output * source_unseen_output.log()).sum(1).mean() loss2 = E_loss.item() CE_loss += args.entropy_loss_weight * E_loss

File "C:/Users/Dell/Downloadstrain.py", line 158, in train
source_unseen_output = torch.softmax(torch.mm(source_fc8, unseen_vec.t()) * self.entropy_lambda, dim=1)
AttributeError: module 'torch' has no attribute 'softmax'

0

  • 编辑 收藏 删除 结题
  • 追加酬金 (90%的用户在追加酬金后获得了解决方案)

    当前问题酬金

    ¥ 0 (可追加 ¥500)

    支付方式

    扫码支付

    加载中...

    提供问题酬金的用户不参与问题酬金结算和分配

    支付即为同意 《付费问题酬金结算规则》

    2 条回答 默认 最新

    • 爱晚乏客游 2021-05-15 19:23
      关注

      检查下torch的版本

      本回答被题主选为最佳回答 , 对您是否有帮助呢? 本回答被专家选为最佳回答 , 对您是否有帮助呢? 本回答被题主和专家选为最佳回答 , 对您是否有帮助呢?
      按下Enter换行,Ctrl+Enter发表内容
    查看更多回答(1条)

    报告相同问题?

    悬赏问题

    • ¥15 并网逆变器怎么改离网 有没有谁可以破解 kml 格式的指标公式、有偿! 关于我在docker容器里重新打开文件但是一直失败的问题 layui怎么实现子窗口修改完成后,用原来查询条件刷新父页面 perl解释器装上之后如何使用 ctf find_fake_fast错位偏移 pycharm无法启动打开 freertos中断使用队列传输后不能退出