错误:AttributeError: ‘float’ object has no attribute ‘decode’
来源:jieba.lcut(x)
修改:jieba.lcut(str(x))
错误:ValueError: Input 0 is incompatible with layer lstm_2: expected ndim=3, found ndim=2
来源:
model.add(LSTM(units=64, activation='tanh', inner_activation='hard_sigmoid'))
model.add(Dropout(0.5))
model.add(LSTM(units=64, activation='tanh'))
model.add(Dense(3, activation='softmax'))
修改:除了最后一个LSTM,其他的都加上 return_sequences=True
model.add(LSTM(units=64, activation='tanh', inner_activation='hard_sigmoid',return_sequences=True))
model.add(Dropout(0.5))
model.add(LSTM(units=64, activation='tanh'))
model.add(Dense(3, activation='softmax'))
原因:
pydot
failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.import os
cur_path = os.getcwd()
print(cur_path)
# 输出:/home/zmh/Documents/learn/python
pos = pd.read_csv(pos_path,header=None,index_col=None)
pos = pd.read_csv(pos_path,header=None,index_col=None,error_bad_lines=False)