![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
人工智能
又酸又菜又多余的菜
这个作者很懒,什么都没留下…
展开
-
TypeError: expected bytes, Example found
tensorflow在写入tfrcords文件时,报错:TypeError: expected bytes, Example found注意:字符串为一个序列化的Example,Example.SerializeToString()所以代码应为:file.write(example.SerializeToString())...原创 2019-10-21 16:24:58 · 426 阅读 · 0 评论 -
TypeError: No positional arguments allowed
tensorflow将图片信息写入tfrecords文件时,报错如下:TypeError: No positional arguments allowed原因:tf.train.Features要求按关键字/参数对传递解决方法:按以下格式传递example = tf.train.Example(features=tf.train.Features(feature=f...原创 2019-10-21 16:22:43 · 4206 阅读 · 1 评论 -
AttributeError: __enter__
tensorflow报错如下with tf.Session as sess:AttributeError: __enter__解决方法:with tf.Session()as sess:如上所示,错误原因为忘记在Session后加()原创 2019-10-21 16:12:50 · 1917 阅读 · 0 评论 -
Found input variables with inconsistent numbers of samples
mean_squared_error(y_true, y_predict)报错:Found input variables with inconsistent numbers of samples原因:y_true和y_predict行数不一致问题y_true.shapey_predict.shape查看真实值和预测值的形状...原创 2019-09-26 14:24:03 · 44321 阅读 · 7 评论 -
module 'tensorflow' has no attribute 'Session'
默认安装了TensorFlow2.0,tf.Session(),报错module 'tensorflow' has no attribute 'Session'原因是2.0,要将tf.Session改为tf.compat.v1.Session()原创 2019-10-09 15:42:25 · 245 阅读 · 0 评论