Skip to content
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

有个关于recbole源码的问题 #16

Open
MING8276 opened this issue Nov 29, 2023 · 1 comment
Open

有个关于recbole源码的问题 #16

MING8276 opened this issue Nov 29, 2023 · 1 comment

Comments

@MING8276
Copy link

当我执行pretrain.py的pretrain_dataset = dataset.build()[0]这一行代码,报错new_data[k] = torch.LongTensor(value) TypeError: new(): data must be a sequence (got builtin_function_or_method)。于是我追踪调试,发现是rocbole源码的dataset.py这个文件中2213行出现错误,其中描述的是value = data[k].values,我想原作者应该是想让value是一个张量,但是我调试发现data[k]本身就是一个Tensor了,data[k].values得到的反而是一个方法,而不是一个Tensor,所以导致2136行:new_data[k] = torch.LongTensor(value),报错:new_data[k] = torch.LongTensor(value) TypeError: new(): data must be a sequence (got builtin_function_or_method)。 请问大家遇到过这个问题吗?我的做法是手动修改了value = data[k].values 改成value = data[k],这样目前是不报错了,但是不知道这样可不可以

@hyp1231
Copy link
Member

hyp1231 commented Mar 19, 2024

你好,抱歉这么晚回复,请问问题解决了吗?感觉可能是 PyTorch 版本和 RecBole 版本有一些不一致。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants