跳转至内容
  • 社区首页
  • 版块
  • 最新
  • 标签
  • 热门
折叠

GitHub中文论坛

  1. 主页
  2. 版块
  3. 综合交流
  4. pytorch报错:AttributeError: module 'torch.nn._reduction' has no attribute 'get_enum'

pytorch报错:AttributeError: module 'torch.nn._reduction' has no attribute 'get_enum'

已定时 已固定 已锁定 已移动 综合交流
1 帖子 1 发布者 227 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • SimplicisimumS 离线
    SimplicisimumS 离线
    Simplicisimum
    写于 最后由 编辑
    #1

    本人小白,刚步入研究生生涯,看B站网课学机器学习,copy了视频里的代码在pycharm上跑了下报错了,各位大神能帮忙看看错误原因嘛😊 😊 ,十分感谢!
    代码链接:https://blog.csdn.net/bit452/article/details/109677086
    报错原因:F:\Anaconda3\envs\pytorch\python.exe C:/Users/84462/PycharmProjects/pythonProject2/TEST.py
    Traceback (most recent call last):
    File "C:\Users\84462\PycharmProjects\pythonProject2\TEST.py", line 40, in <module>
    loss = criterion(y_pred, y_data) # forward: loss
    File "F:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
    File "F:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\loss.py", line 530, in forward
    return F.mse_loss(input, target, reduction=self.reduction)
    File "F:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 3280, in mse_loss
    return torch._C._nn.mse_loss(expanded_input, expanded_target, _Reduction.get_enum(reduction))
    AttributeError: module 'torch.nn._reduction' has no attribute 'get_enum'

    1 条回复 最后回复
    0
    回复
    • 在新帖中回复
    登录后回复
    • 从旧到新
    • 从新到旧
    • 最多赞同


    • 登录

    • 第一个帖子
      最后一个帖子
    0
    • 社区首页
    • 版块
    • 最新
    • 标签
    • 热门