- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 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
462
原创 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
4405
1
原创 AttributeError: __enter__
tensorflow报错如下with tf.Session as sess:AttributeError: __enter__解决方法:with tf.Session()as sess:如上所示,错误原因为忘记在Session后加()
2019-10-21 16:12:50
1972
原创 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
275
原创 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
44524
7
原创 setuptools pip wheel failed with error code 2
使用mkvirualenv创建环境报错setuptools pip wheel failed with error code 2尝试更新setuptools版本,命令如下pip install --upgrade setuptools再次执行mkvirualenv ml问题解决!顺便还更新了下pip的版本python -m pip install...
2019-07-31 15:06:14
4133
2
原创 call/apply/bind的异同
相同:1、都可以修改this向不同:1、apply和call第一个参数都是指向对象;2、执行时间不同。call和apply修改过this的指向后立即执行这个函数,bind修改过this指向想什么时候执行都可以...
2019-07-30 15:18:50
177
原创 javascript的this调用关系
1、全局function () { console.log(this); //window}2、隐式绑定,函数调用时拥有上下文环境function ff(){ console.log(this.a)}var ss = { a : 3;}ss.ff(); //33、显示调用,如用call/apply/bind等方式改变this的指向...
2019-07-30 15:09:13
93
原创 sys.stdout.write刷新进度条的问题
sys.stdout.write( " 已下载:%.3f%%" % float(i / ss.nums) + “\r”)显示无进度条解决方法:sys.stdout.write(’\r’ + " 已下载:%.3f%%" % float(i / ss.nums))
2019-04-02 11:16:41
841
原创 bs4节点文字获取
获取到下面的节点列表[免费第1章 奇葩应聘条件, 免费第2章 只闻其声未见其人, 免费第3章 人生处处有惊喜]想获取a标签内的标题字符串,用each.string,结果为none。用**each.contents[i]**才可以...
2019-04-01 14:56:27
1114
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人