在用Embedding时出现了这个问题,具体的代码:

model.add(Embedding(input_dim = vocab_size, output_dim = embedding_vector_size, input_length = max_len, weights = [embedding_matrix]))

本来以为是参数类型的问题,但怎么也找不出来,最后看github发现了解决方法:重装numpy(我也不知道为什么—.—)

记住在重装numpy的时候要关掉你的IDE或jupyter notebook,不然会出现类似:

PermissionError: [WinError 5] 拒绝访问。的警告,可能导致删不干净。

然后重装numpy即可

pip uninstall numpy
pip install numpy

 

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2021-10-01
  • 2021-11-01
  • 2022-12-23
  • 2021-09-15
  • 2021-05-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2021-10-16
  • 2021-05-17
相关资源
相似解决方案