You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(moltrans) D:\PaddleHelix-dev\apps\drug_target_interaction\moltrans_dti>python train_cls.py --batchsize 64 --epochs 200 --lr 5e-4 --dataset cls_davis
Traceback (most recent call last):
File "train_cls.py", line 18, in
from helper import utils
File "D:\PaddleHelix-dev\apps\drug_target_interaction\moltrans_dti\helper\utils_init_.py", line 23, in
from .paddle_varbase import *
File "D:\PaddleHelix-dev\apps\drug_target_interaction\moltrans_dti\helper\utils\paddle_varbase.py", line 21, in
VarBase.tmp = VarBase.getitem
AttributeError: type object 'paddle.fluid.libpaddle.VarBase' has no attribute 'getitem'
The text was updated successfully, but these errors were encountered:
ShaunZhang7
changed the title
运行脚本python train_cls.py报错,AttributeError: type object 'paddle.fluid.libpaddle.VarBase' has no attribute '__getitem__'
运行脚本train_cls.py报错,AttributeError: type object 'paddle.fluid.libpaddle.VarBase' has no attribute '__getitem__'
Dec 21, 2023
您好,非常感谢您查阅此问题。
我的问题是在运行脚本python train_cls.py --epochs 200 --lr 5e-4 --dataset cls_davis时打印:
(moltrans) D:\PaddleHelix-dev\apps\drug_target_interaction\moltrans_dti>python train_cls.py --batchsize 64 --epochs 200 --lr 5e-4 --dataset cls_davis
Traceback (most recent call last):
File "train_cls.py", line 18, in
from helper import utils
File "D:\PaddleHelix-dev\apps\drug_target_interaction\moltrans_dti\helper\utils_init_.py", line 23, in
from .paddle_varbase import *
File "D:\PaddleHelix-dev\apps\drug_target_interaction\moltrans_dti\helper\utils\paddle_varbase.py", line 21, in
VarBase.tmp = VarBase.getitem
AttributeError: type object 'paddle.fluid.libpaddle.VarBase' has no attribute 'getitem'
提示:属性/方法错误:没有方法'getitem'
之前以为是版本导致的API问题,但后面查询这个错误通常表示正在尝试访问None对象中不存在的属性或方法,它通常与使用函数中的None值作为返回值有关,而不是返回正确的值。
但是代码里这个方法报错的地方我不太确定为什么会出错:
VarBase.tmp = VarBase.getitem
包括下面的:
VarBase.setitem_tmp = VarBase.setitem
本人水平有限,如果您知道为什么出错以及怎么解决此类问题的话希望能不吝赐教,非常期待得到您的回复,此致感谢!
联系邮箱:1090257784@qq.com
The text was updated successfully, but these errors were encountered: