程序错误
包括运行调试程序的错误,解决方法
普通且自信66
这个作者很懒,什么都没留下…
展开
-
AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'Optimizer',tensorflow报错
tensorflow版本不对卸载重新安装pip uninstall tensorflow我之前是2.0.0的版本,然后重装的1.5.0,没有再报这个错误pip install tensorflow==1.5.0原创 2019-11-07 10:54:18 · 26084 阅读 · 9 评论 -
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'.
python 版本问题,老的代码导致的 print>>wf,'%d\t%s' % (wid, w)换成print(wf,'%d\t%s' % (wid, w))原创 2019-11-06 00:41:14 · 4687 阅读 · 0 评论 -
UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 119221: illegal multibyte
文件编码错误修改之前 with open("attribute_"+data_type+"_sample.txt", "w") as f: f.write("\n".join(training_seq_result))之后 with open("attribute_"+data_type+"_sample.txt", "w",encoding="utf-8")...原创 2019-10-28 21:58:19 · 1228 阅读 · 0 评论 -
AttributeError: 'str' object has no attribute 'decode'
源码entities = t_str.split("|||")[0].split(">")[1].strip().decode("utf-8")修改entities = t_str.split("|||")[0].split(">")[1].strip().encode("utf-8").decode("utf-8")原创 2019-10-28 20:50:08 · 464 阅读 · 0 评论 -
AttributeError: module 'ahocorasick' has no attribute 'Automaton'解决
在运行中科院软件所刘老师的代码时出现的小bug,感谢!问题:AttributeError: module ‘ahocorasick’ has no attribute ‘Automaton’原因:导入了ahocorasick-python这个包,把他删了,然后再重新导入pyshocorasick源代码...转载 2019-07-29 16:02:18 · 2655 阅读 · 1 评论