我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

python报错KeyError: 231是什么意思?

if prefix_words:
for word in prefix_words:
output,hidden = model(input,hidden)
input = Variable(input.data.new([word2ix[word]])).view(1,1)

File "main.py", line 103, in gen_acrostic
input = Variable(input.data.new([word2ix[word]])).view(1,1)
KeyError: 231


word2ix中没有word]]这个条目。你输出下word所有的key,以及word2ix的,对比下

近期文章

  • AS中向模拟器传递并运行application并出现以下乱码报错,但并不影响运行,就解决方法?
  • 深色主题VirtualBox界面错误
  • 0x1.f40000000000p+14
  • C Primer Plus 8.8练习题 编写一个菜单,提供加减乘除的选项进行计算
  • 层次分析法算绩效不会算了,求大佬!
  • 这个代码一直跳出does not name a type是什么原因还有怎么解决?
  • 求助大神,一道题简单的题希望帮忙改改
  • 单向链表删除节点问题
  • 用conda更新的时候出错有如下提示,这是什么意思呢?
  • 用python的pandas做两个excel的表格拼接,为什么会出现这种情况?
  • python3.6安装whl问题
  • 搞了一个晚上了,求指点 Uncaught TypeError: Cannot read property 'offsetHeight' of null
  • python 爬虫 输出数字却显示为乱码
  • The Frog's Games 计算的问题
  • Find Metal Mineral 编写的方法
  • To Miss Our Children Time 时间问题
  • Find the maximum 最大数的计算问题
  • The kth great number
  • The war 战争的算法
  • Parent and son 父子的问题

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华