各种error总结
各种error总结
我对算法一无所知
人生处处是捷径,不绕远儿就是捷径。
展开
-
rasa 中文 UnsupportedLanguageError: component ‘LanguageModelTokenizer‘ does not support language ‘zh‘.
LanguageModelTokenizer组件已被弃用,部分原因是它无法处理非空白标记化的语言,如中文。可以使用JiebaTokenizer代替。# Configuration for Rasa NLU.# https://rasa.com/docs/rasa/nlu/components/language: zhpipeline:# # No configuration for the NLU pipeline was provided. The following default pi原创 2021-05-21 15:54:30 · 1443 阅读 · 2 评论 -
pandas.errors.ParserError: Error tokenizing data. C error: EOF inside string starting at line xxx
import pandas as pddata = pd.read_csv('data.txt', sep='\t')报错:pandas.errors.ParserError: Error tokenizing data. C error: EOF inside string starting at line xxx改为:import pandas as pdimport csvdata = pd.read_csv('data.txt', sep='\t', error_bad_l.原创 2021-03-16 10:22:11 · 760 阅读 · 0 评论 -
AttributeError: ‘_IncompatibleKeys‘ object has no attribute ‘cuda‘
完整报错信息如下:Traceback (most recent call last): File "bert.py", line 172, in <module> output = predict('../../../data/end2end/title_content5.csv', model_path='../../../data/end2end/bert.pth') File "bert.py", line 149, in predict model = mo原创 2021-03-05 11:07:27 · 2022 阅读 · 4 评论 -
AttributeError: ‘torch.return_types.max‘ object has no attribute ‘dim‘
out1 = torch.max(out1, 1) # (batch, embedding_size)out1 = self.linear(out1) # (batch, linear_hidden_size)抛出错误 File "/diske/Anaconda3/envs/pytorch1.4/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self..原创 2021-01-22 10:30:28 · 5062 阅读 · 0 评论 -
Macbook安装brew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"亲测可用原创 2021-01-12 20:04:36 · 215 阅读 · 0 评论 -
SyntaxError: Non-ASCII character ‘\xe4‘ in file baseline.py on line 18, but no encoding declared;
出现错误:SyntaxError: Non-ASCII character '\xe4' in file baseline.py on line 18, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details解决办法:在文件开头加入 #-*-coding:utf-8 -*-# 出现错误File "baseline.py", line 18SyntaxError: Non-ASCII c原创 2021-01-07 10:34:34 · 212 阅读 · 0 评论 -
ValueError: expected sequence of length 791 at dim 1 (got 185)
File "baseline.py", line 25, in <module> input_id = torch.tensor(tokens2ids)ValueError: expected sequence of length 791 at dim 1 (got 185)list维度不一样,检查一下维度应该是input_id = torch.tensor(padded_ids)原创 2021-01-06 19:58:56 · 3938 阅读 · 0 评论 -
有的时候print函数不会立即打印的解决办法(flush=True)
最近在跑模型,数据文件太大读取时间很长,于是就是print一个标志,但是发现print不会立刻输出,总是在文件都加载完才输出,那我要你何用。。。在网上查了一下,说是print会先输出到缓冲区,所以print不能立刻打印出来,写了这么久python我也是刚知道还有这个东西,,,需要刷新一下缓冲区就可以了,python3提供了这个参数print(xxx, flush=True)加上之后就好了...原创 2020-12-08 10:51:52 · 1136 阅读 · 0 评论 -
Python读取文件时出现UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x80 in position ...
with open(self.path, 'r') as test: for line in test: pass代码如上,出现错误:UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position ...UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 9: ...或者是UnicodeDecodeErr..原创 2020-10-17 09:38:49 · 63455 阅读 · 14 评论 -
安装nodejs出现Invalid drive: f:\的解决办法
我电脑装了linux双系统,大概是这个原因造成的解决办法:win+r, 输入subst F: %TEMP%然后win+r,输入 subst F:/F自己是哪个盘就写哪个盘然后重新执行node安装程序就可以了原创 2020-09-02 23:50:33 · 2317 阅读 · 0 评论 -
解决git克隆项目出现fatal无法访问‘https://github.com/xxx/xxx‘Unsupported proxy syntax in‘127.0.0.1:8118‘
当使用git clone时出现如下问题首先查看git的配置列表git config --list如下图 :可以看到有两个代理配置,http.proxy和https.proxy,就是这两个配置的原因删除这两项git config --global --unset http.proxygit config --global --unset https.proxy可以看到git可以正常clone项目了...原创 2020-06-29 11:44:22 · 47228 阅读 · 13 评论