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

bert_sent__embed.py 中的list没有to属性 #1

Open
shx5625958 opened this issue Aug 31, 2021 · 1 comment
Open

bert_sent__embed.py 中的list没有to属性 #1

shx5625958 opened this issue Aug 31, 2021 · 1 comment

Comments

@shx5625958
Copy link

您的代码中的bert_sent__embed.py文件中的sent1 = data['sent1_input_ids'].to(device)
这里从dataload中取出data,将data放进device时报错list没有to属性
我不知道怎么解决

@shx5625958
Copy link
Author

        sent1 = []
        for item in data['sent1_input_ids']:
            item1 = item.to(device)
            sent1.append(item1)

我这样解决的不知道可不可以

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

1 participant