- 博客(22)
- 收藏
- 关注
原创 ImportError “No Module named Setuptools”
pip install --upgrade setuptoolspip uninstall setuptoolspip install setuptools
2019-03-07 10:12:10
527
原创 tf.nn.conv1d
tf.nn.conv1d(value, filters, stride, padding)value的形状:[batch, in_width, in_channels]batch 表示多少个样本 in_width 表示样本的宽度 in_channels 表示样本有多少个通道 可看作一个平铺开的二维数组:[batch, 行数, 列数];filter 的形状:[filter_widt...
2019-03-04 10:24:30
3977
原创 Anaconda安装指定版本的tensorflow
1)condainstall--channelhttps://conda.anaconda.org/anacondatensorflow=1.5.02)pip install tensorflow-gpu==1.4.0
2019-03-01 21:43:37
24956
原创 Anaconda安装tensorflow
创建环境conda create --name tensorflow python=3.5激活环境source activate tensorflow关闭环境source deactivate安装tensorflowanaconda search -t conda tensorflowanaconda show <USER/PACKAGE>...
2019-03-01 14:21:43
314
原创 No module named packaging
1.更新pip3pip3 install --upgrade pip2. 安装packagingpip3 install packaging
2019-02-28 10:46:57
22560
原创 conda command not found
安装成功后使用conda命令报错解决方案:echo 'export PATH="/home/your_name/anaconda3/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
2018-11-01 14:14:37
560
转载 python中基本语法
#输入语句:>>> print'100+100=%d' %(100+100)100+100=200#输出语句>>> name = raw_input('input your name:')input your name:yinheyi>>> print('hello,%s' %name)hello,yinheyi 注...
2018-08-14 19:39:25
789
转载 Python 基本语法 list
list: Python内置的一种数据类型是列表。lists是一个有序的集合,可以添加与删除元素。生成它是用 [] 就可以啦;调用它时,用下标调用就可以啦(从0开始);如第一个元素,list[0];倒数第一个,list[-1];可以用len()函数获得list元素的个数;在尾部添加用append(), 中间插入用insert();尾部删除用pop();指定位置删除为pop(i)...
2018-08-14 19:36:06
202
转载 Tensorflow tf.concat
tf.concat(values, axis)concat沿着某一维度链接tensor, 需要理解tensor 的维度 t1 = [[[1, 1, 1],[2, 2, 2]],[[3, 3, 3],[4, 4, 4]]] t2 = [[[5, 5, 5],[6, 6, 6]],[[7, 7, 7],[8, 8, 8]]] 第0维解释: t1和t2的0维是两个tensor最外层的两个...
2018-08-14 14:23:47
563
原创 TensorFlow 稀疏张量函数:tf.SparseTensor
稀疏张量表示:SparseTensor(indices=[[0, 0], [1, 2]], values=[1, 2], dense_shape=[3, 4])表示稠密张量:[[1, 0, 0, 0] [0, 0, 2, 0] [0, 0, 0, 0]]
2018-08-14 11:01:34
10184
转载 TensorFlow tf.split
tf.split( value, num_or_size_splits, axis=0, num=None, name='split' )这个函数是用来切割张量的。输入切割的张量和参数,返回切割的结果。 value传入的就是需要切割的张量。 这个函数有两种切割的方式:以三个维度的张量为例,比如说一个20 * 30 * 40的张量my_tensor,就如同一个长20厘米宽30厘米高40厘米...
2018-08-14 10:54:37
628
转载 TensorFlow tf.reshape
# tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]# tensor 't' has shape [9]reshape(t, [3, 3]) ==> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]# tensor 't' is [[[...
2018-08-14 09:42:47
209
转载 Python 读写word
#coding=utf-8from docx import Documentfrom docx.shared import Ptfrom docx.shared import Inchesfrom docx.oxml.ns import qn#打开文档document = Document()#加入不同等级的标题document.add_heading(u'MS WORD写入测...
2018-07-28 11:06:30
7020
1
原创 PHP imagecopy()和imagecopyresized()
imagecopy()imagecopy() 函数用于拷贝图像或图像的一部分,成功返回 TRUE ,否则返回 FALSE 。bool imagecopy(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h ) imagecopyr...
2018-07-20 21:19:05
1284
转载 php 查找字符串的首次出现strstr
strstr — 查找字符串的首次出现string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] ) <?php $email = 'yuxiaoxiao@example.com'; $domain = strstr($email, '@'); echo $domain; ...
2018-07-20 21:01:07
1893
原创 TensorFlow:ImportError: libcudnn.so.*: cannot open shared object file: No such file or dictionary
背景:Anaconda下安装的tensorflow完成后,import tensorflow报错:ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory 解决办法: 先到官网注册并下载相应的cudnn库(https://developer.nvidia.com/c...
2018-07-20 16:06:45
304
原创 python TensorFlow Anaconda Spyder
os.path.exists() 用于判断变量、文件等是否存在 Spyder1. 打开偏好设置 快捷键:Shift+Ctrl+Alt+P2. 设置字体/大小:General - Fonts3. 设置注释/代码颜色样式:Syntax Coloring...
2018-07-19 10:05:59
151
原创 【TensorFlow】tf.contrib.data.TFRecordDataset(filenames) 报错
报错:AttributeError: module 'tensorflow.contrib.data' has no attribute 'TFRecordDataset'在TensorFlow 1.3中,Dataset API是放在contrib包中的:tf.contrib.data.Dataset而在TensorFlow 1.4中,Dataset API已经从contrib包中...
2018-07-18 09:18:10
1922
1
原创 python 写入excel表格
# -*- coding: utf-8 -*-import xlwtbook = xlwt.Workbook(encoding='utf-8')sheet = book.add_sheet('sheet1', cell_overwrite_ok=True)sheet.write(0, 0, 'xxx')#写入中文txt='中文'sheet.write(0, 1, txt.deco...
2018-07-17 16:00:17
1236
原创 python读文件
file = open("xxx.txt")line = file.readline()while line != '': #print line #具体操作 line = file.readline()file.close()
2018-07-17 15:53:15
105
原创 Python字符串查找
find()方法:查找子字符串,若找到返回从0开始的下标值,若找不到返回-1info = 'abca'print info.find('a')##从下标0开始,查找在字符串里第一个出现的子串,返回结果:0info = 'abca'print info.find('a',1)##从下标1开始,查找在字符串里第一个出现的子串:返回结果3...
2018-07-17 15:47:46
358
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人