649453932 / Bert-Chinese-Text-Classification-Pytorch

使用Bert,ERNIE,进行中文文本分类
MIT License
4.03k stars 899 forks source link

UserWarning: This overload of add_ is deprecated: add_(Number alpha, Tensor other) #113

Open Prometheus-F opened 2 years ago

Prometheus-F commented 2 years ago

D:\Bert-Chinese-Text-Classification-Pytorch\pytorchpretrained\optimization.py:275: UserWarning: This overload of add is deprecated: add(Number alpha, Tensor other) Consider using one of the following signatures instead: add(Tensor other, *, Number alpha) (Triggered internally at ..\torch\csrc\utils\python_arg_parser.cpp:1025.) nextm.mul(beta1).add_(1 - beta1, grad) 请问这个怎么解决呢

foxbrucecui commented 2 years ago

我也遇到了这个

cfjcyc0301 commented 2 years ago

D:\Bert-Chinese-Text-Classification-Pytorch\pytorchpretrained\optimization.py:275: UserWarning: This overload of add is deprecated: add(Number alpha, Tensor other) Consider using one of the following signatures instead: add(Tensor other, *, Number alpha) (Triggered internally at ..\torch\csrc\utils\python_arg_parser.cpp:1025.) nextm.mul(beta1).add_(1 - beta1, grad) 请问这个怎么解决呢

请问你解决了吗?

cfjcyc0301 commented 2 years ago

我也遇到了这个

你好,你解决这个问题了吗

ytWu1314 commented 2 years ago

UserWarning: This overload of add is deprecated: add(Number alpha, Tensor other) Consider using one of the following signatures instead: add_(Tensor other, *, Number alpha) (Triggered internally at ..\torch\csrc\utils\python_arg_parser.cpp:882.) nextm.mul(beta1).add_(1 - beta1, grad) 同问+1

panxmay commented 2 years ago

同问+1 请问下大家都怎么解决的这个问题呀

zzr0702 commented 2 years ago

改为add_(grad, alpha=1 - beta1)即可

sjghh commented 2 years ago

该了也不行啊

KangChou commented 1 year ago

D:\Bert-Chinese-Text-Classification-Pytorch\pytorchpretrained\optimization.py:275: UserWarning: This overload of add is deprecated: add(Number alpha, Tensor other) Consider using one of the following signatures instead: add(Tensor other, *, Number alpha) (Triggered internally at ..\torch\csrc\utils\python_arg_parser.cpp:1025.) nextm.mul(beta1).add_(1 - beta1, grad) 请问这个怎么解决呢

应该是速度的问题,这只是警告,但是算法内部函数代码的一些接口还是可以继续用。只是CPU比较慢,你等等吧。

image