Skip to content

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

Description

@BoKaiSun

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()即可
建议注明

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions