2018年6月22日

TypeError: Value passed to parameter 'a' has DataType int64 not in list of allowed values: float16,

摘要: 这是我在做多元线性回归时遇到的错误:这个也是数据类型类的错误; 解决办法就是把数据的类型转化之后就行的了,于‘TypeError: Input 'b' of 'MatMul' Op has type int64 that does not match type float32 of argument 阅读全文

posted @ 2018-06-22 22:49 blueslichanghui 阅读(691) 评论(0) 推荐(0)

TypeError: Input 'b' of 'MatMul' Op has type int64 that does not match type float32 of argument 'a'.

摘要: 在做多元线性回归的时候多余模型:y = tf.matmul(x_data,w) +b 中: 我的x_data 使用tf.placeholder(tf.float32,[1,2]) 申明的; 而我的输入的是整数 解决办法: 1:直接把输入输成浮点型的,如:输入3,你可以直接输入3.00 2:加上类型转 阅读全文

posted @ 2018-06-22 22:48 blueslichanghui 阅读(1098) 评论(0) 推荐(0)

Shape must be rank 2 but is rank 1 for 'MatMul'

摘要: 我在做多元线性回归的时候,在预测数据时遇到的: 这是由于我录入的数据如:[1,2] 他的shape是[2,],而我在参数(也就是y = w1*x1+w2*x2+b 中的w)用的是placeholder生成, shape是(2,1)的;所以无法进行矩阵乘法; 解决办法是: 在录入数据的时候通过data 阅读全文

posted @ 2018-06-22 22:48 blueslichanghui 阅读(1936) 评论(0) 推荐(0)

tensorflow基于csv数据集实现多元线性回归并预测

摘要: #coding:utf8 import tensorflow as tf from sklearn import linear_model from sklearn import preprocessing import numpy as np def read_data(file_queue): 阅读全文

posted @ 2018-06-22 22:46 blueslichanghui 阅读(1819) 评论(0) 推荐(0)

2018年5月28日

python logging 模块

摘要: logging模块 很多程序都有记录日志的需求,并且日志中包含的信息即有正常的程序访问日志,还可能有错误、警告等信息输出,python的logging模块提供了标准的日志接口,你可以通过它存储各种格式的日志,logging的日志可以分为 debug(), info(), warning(), err 阅读全文

posted @ 2018-05-28 22:36 blueslichanghui 阅读(140) 评论(0) 推荐(0)

python hashlib 模块

摘要: hashlib模块 用于加密相关的操作,3.x里代替了md5模块和sha模块,主要提供 SHA1, SHA224, SHA256, SHA384, SHA512 ,MD5 算法 import hashlib m = hashlib.md5() m.update(b"Hello") m.update( 阅读全文

posted @ 2018-05-28 22:35 blueslichanghui 阅读(124) 评论(0) 推荐(0)

python subprocess模块

摘要: Subprocess模块 The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This m 阅读全文

posted @ 2018-05-28 22:35 blueslichanghui 阅读(130) 评论(0) 推荐(0)

python configparse 模块

摘要: ConfigParser模块 用于生成和修改常见配置文档,当前模块的名称在 python 3.x 版本中变更为 configparser。 来看一个好多软件的常见文档格式如下 [DEFAULT] ServerAliveInterval = 45 Compression = yes Compressi 阅读全文

posted @ 2018-05-28 22:34 blueslichanghui 阅读(145) 评论(0) 推荐(0)

python xml 模块

摘要: 文档格式 <?xml version="1.0"?><data> <country name="Liechtenstein"> <rank updated="yes">2</rank><year>2008</year> <gdppc>141100</gdppc> <neighbor name="Au 阅读全文

posted @ 2018-05-28 22:33 blueslichanghui 阅读(124) 评论(0) 推荐(0)

python shutil 模块

摘要: python 是一个高级的文件,文件夹和压缩包的处理模块 那么他有什么使用方法呢: 阅读全文

posted @ 2018-05-28 22:32 blueslichanghui 阅读(155) 评论(0) 推荐(0)

导航