【fairseq】RuntimeError: Unrecognized tensor type ID: AutogradCUDA

今天在运行https://github.com/Yale-LILY/ConvoSumm/tree/master/code的程序的时候,使用的是fairseq训练的,训练的时候出现了下面的错误:

line 396, in forward_embedding
    x = self.layernorm_embedding(x)
  File "/home/eric/anaconda3/envs/seg/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/media/data/projects/A24196/ConvoSumm/code/fairseq/fairseq/modules/layer_norm.py",
line 23, in forward
    return super().forward(x)
  File "/home/eric/anaconda3/envs/seg/lib/python3.6/site-packages/apex/normalization/fused_layer_norm.py", line 159, in forward
    input, self.weight, self.bias, self.normalized_shape,self.eps)
  File "/home/eric/anaconda3/envs/seg/lib/python3.6/site-packages/apex/normalization/fused_layer_norm.py", line 25, in forward
    input_, ctx.normalized_shape, weight_, bias_, ctx.eps)
RuntimeError: Unrecognized tensor type ID: AutogradCUDA

网上搜了一下可能是torch版本的原因,我的torch版本是torch-1.8.1+cu102

解决方法

直接pip降低torch的版本到1.6.

pip install torch==1.6

然后重新训练,发现不报错了。

参考文献

Encountering error: Unrecognized tensor type ID: AutogradCUDA

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
As an AI language model, I do not have access to the code or data you are working with, so I cannot provide a specific solution for your problem. However, I can explain what the error message "RuntimeError: Unrecognized data format" usually means and suggest some possible solutions. This error occurs when the program is unable to recognize the format of the data it is trying to process. It can happen in many different contexts, such as reading input files, parsing data, or decoding messages. Some possible causes of this error include: - Using the wrong file extension or encoding when reading data files. - Passing data in the wrong format or structure to a function or method. - Using an outdated or unsupported data format or library. - Corrupted or incomplete data that cannot be parsed correctly. To fix this error, you should try the following steps: - Check the documentation and specifications of the data format you are using to ensure you are using it correctly. - Verify that the data files you are reading have the correct file extension and encoding. - If you are passing data to a function or method, check that it is in the expected format and structure. - Try using a different data format or library that is more up-to-date or better suited for your needs. - If the data is corrupted or incomplete, try to recover or recreate it if possible. If none of these solutions work, you may need to seek help from a more experienced programmer or expert in the specific field of data processing you are working with.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

农民小飞侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值