1.20180621:tuple<class tuple>:arrary格式获取
2.20180622:InvalidArgumentError (see above for traceback): In[0] is not a matrix,一维函数不支持
The error message gives a clue to the problem: neither W nor x1 is a 2-D matrix—in fact, both are 1-D vectors—and the tensorflow::ops::MatMul()
op requires that both of its arguments are at least 2-dimensional. It does not automatically convert vectors to their matrix representation, and you must do this manually.
To solve the problem, specify TensorShape({1, 2}) when you construct W and TensorShape({2, 1}) when you construct x1.
With these shapes, you should not set MatMul::TransposeA(false) and MatMul::TransposeB(false), or you can omit these options since they are the default values.
这个问题,是我在预测的时候,bitch_size=1,就是说,只输入了一个,结果不行,弄成list形式,就是说,copy了一个,是的ditch_size=2,就可以了。
3.(20180627) AttributeError: module 'xpinyin' has no attribute 'Pinyin' 定义了一个与模块包一样的pymodel
4.(20180628) FailedPreconditionError (see above for traceback): Attempting to use uninitialized value conv_layer-1/w
原因:初始化不对,已经不在需要model,只需要input, predition获取就好
此外还有:class从1开始,1,2,3,4,5,6
5.(20180702) 5.1 TypeError: 'int' object is not subscriptable,开始以为是label2idx, idx2label = defaultdict(), defaultdict()的原因,结果不是
这个问题是return那里没有给全返回的变量,valid_accuracye, prede, losse = evaluate(valid_model,session,valid_data, idx2label,idx2word, global_steps)
5.2 Running tf.where and getting TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed
这个问题主要是由count, prediction, loss = session.run([fetches,prediction,loss], feed_dict)引起的,注意:[fetches,prediction,loss]要有方括号
6.(20180703) 6.1 KeyError: "The name 'input_x' refers to an Operation not in the graph."
这个问题主要是 input_data = graph.get_operation_by_name("model/input_data").outputs[0]引起的,这个当时没有加“model”
6.2 UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 8: illegal multibyte sequence
这个错误还是编码问题,主要是由于utf-8引起的,问题来自split()不正确
6.3 The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available...
这个问题,加上 import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' 就好了,不过是把问题隐藏起来