- 博客(5)
- 收藏
- 关注
原创 图像单通道和4通道转3通道
单通道转3通道from PIL import Imageimport numpy as npim = np.asarray(Image.open(path))if len(im) == 2: c = [] for i in range(3): c.append(im) im = np.asarray(c)4通道转3通道
2018-05-27 10:27:30
11988
3
转载 python3打开pkl文件
python3中带有pickle包对pkl文件进行操作。 打开带有中文的pkl文件或者其他字符的文件不能用默认的ascii格式打开,需要指定编码格式:import pickle# f = open('dict_word.pkl', 'rb')# for line in f:# print(line)word = pickle.load(open("word.pkl", 'rb')...
2018-05-02 19:53:26
5918
3
原创 python2代码转python3
方法一:通过使用命令行工具2to3将python2.7代码转换为Python 32to3 -w test.py方法二:参考:http://python-future.org/quickstart.html#to-convert-existing-python-2-code
2018-05-02 11:25:43
320
原创 python 写入txt,出现漏写现象
重复with open("douban.txt","w") as f:for i in a:f.write(i)将a内容写入文本douban.txt,有时会出现漏写,重复运行两次就解决了
2017-10-25 15:52:48
1595
原创 tensorflow函数 tf.nn.xw_plus_b
tf.nn.xw_plus_b((x, weights) + biases.) 相当于matmul(x, weights) + biases.
2017-08-14 10:09:38
9939
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人