【问题标题】:NLP function in Standford NLP returning dtype error斯坦福 NLP 中的 NLP 函数返回 dtype 错误
【发布时间】:2021-04-13 14:44:02
【问题描述】:

NLP 初学者,我正在尝试运行以下代码,但出现以下错误。

doc = nlp("巴拉克奥巴马在夏威夷")

doc.sentences[0].print_dependencies()

错误:

文件“C:\Users\anaconda3\lib\site-packages\stanfordnlp\models\common\seq2seq_model.py”,第 193 行,在 update_state s.data.copy_(s.data.index_select(0, position))

RuntimeError: index_select(): Expected dtype int64 for index

【问题讨论】:

    标签: stanford-nlp


    【解决方案1】:

    这是由于 pytorch 版本。您可以使用 pytorch 1.4.0 版本。这将解决这个问题/错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-12
      • 1970-01-01
      • 1970-01-01
      • 2015-04-30
      相关资源
      最近更新 更多