-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'tuple' object has no attribute 'is_cuda' #52
Comments
有没有训练的脚本? |
为了使用past_key_values,我用https://github.com/TsinghuaAI/CPM-1-Generate中的model/gpt2_modeling.py和mpu/transformer.py做了替换后,就出现了上面的错误 |
原来应该也是可以使用 past_key_values 的 |
cpm1-generate做了更新:TsinghuaAI/CPM-1-Generate@2730b1f#diff-a7922243f0695439497bd5bdae2069ec8fa268d10d549afc26fcd2765646a36e 我仔细对比没发现有什么问题,但是在layernorm_output = self.input_layernorm(hidden_states) 会报 is_cuda的错误 |
那用 CPM-1-Generate 也会报错? |
刚跑了可以通,我把cpm1和cpm2放一块了,可能是哪里起冲突了吧 |
/mpu/transformer.py", line 422, in custom_forward
x_ = layer(x_, inputs[1])
File "/home/jovyan/miniconda3/envs/cpm2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jovyan/xz_nlp/icode/CPM-2-Finetune-master/mpu/transformer.py", line 304, in forward
layernorm_output = self.input_layernorm(hidden_states)
File "/home/jovyan/miniconda3/envs/cpm2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jovyan/miniconda3/envs/cpm2/lib/python3.7/site-packages/apex/normalization/fused_layer_norm.py", line 290, in forward
if not input.is_cuda:
AttributeError: 'tuple' object has no attribute 'is_cuda'
报错怎么解
The text was updated successfully, but these errors were encountered: