Skip to content

TypeError: expected np.ndarray (got numpy.ndarray) #3

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

Open
BoKaiSun opened this issue Jul 9, 2019 · 0 comments
Open

TypeError: expected np.ndarray (got numpy.ndarray) #3

BoKaiSun opened this issue Jul 9, 2019 · 0 comments

Comments

@BoKaiSun
Copy link

BoKaiSun commented Jul 9, 2019

weight[index, :] = torch.from_numpy(wvmodel.get_vector(idx_to_word[word_to_idx[wvmodel.index2word[i]]]))
高版本会报错(如101版)
TypeError: expected np.ndarray (got numpy.ndarray)
将torch.from_numpy()改为torch.Tensor()即可
建议注明

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