![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
冬日and暖阳
Github: https://github.com/pengfeidip
邮箱:pengfeidip@qq.com
展开
-
tf.control_dependencies()作用及用法
转载自: https://blog.csdn.net/PKU_Jade/article/details/73498753 在有些机器学习程序中我们想要指定某些操作执行的依赖关系,这时我们可以使用tf.control_dependencies()来实现。 control_dependencies(control_in...转载 2018-07-03 16:28:43 · 1270 阅读 · 0 评论 -
anaconda中 tensorflow的gpu版本配置CUDA和CUDNN
转载整理自:https://blog.csdn.net/xccccz/article/details/80385448背景: win10 + anaconda + tensorflow gpu 1.9 配置cuda 9.0+cudnn 7.1.4 成功注意: 1. 一定要注意版本相对应的问题; 2. 作者写的很详细,一步一步来就行了...转载 2018-08-08 16:53:30 · 2278 阅读 · 0 评论 -
Tensorflow 内存占用
Tensflow 内存占用有以下特点: 一 : 默认瞬间占用所有GPU的所有显存;(但是可以设置占用上限, 以及动态占用)# 动态占用: 根据需要自主申请显存config = tf.ConfigProto()config.gpu_options.allow_growth = Truesession = tf.Session(config=config, ...)# 占中上限: 设置...原创 2018-08-01 21:36:01 · 4087 阅读 · 0 评论 -
TensorFlow 显存使用机制
默认情况下,TensorFlow 会映射进程可见的所有 GPU 的几乎所有 GPU 内存(取决于 CUDA_VISIBLE_DEVICES)。通过减少内存碎片,可以更有效地使用设备上相对宝贵的 GPU 内存资源。在某些情况下,最理想的是进程只分配可用内存的一个子集,或者仅根据进程需要增加内存使用量。 TensorFlow 在 Session 上提供两个 Config 选项来进行控制。(1)...原创 2018-08-01 21:18:12 · 2167 阅读 · 0 评论 -
TensorFlow: Resource exhausted: OOM when allocating tensor with shape[59500, 28, 28, 1]
背景: 基于GPU, 用TensorFlow评估模型性能, 直接输出了59500个样本问题:TensorFlow 提示: Resource exhausted: OOM when allocating tensor with shape[10000,32,28,28]原因一次性输入过度数据, 显存无法容纳解决分批次输入数据, 统计正确分类的个数...原创 2018-08-01 19:33:25 · 3396 阅读 · 0 评论 -
tensorflow中的padding/卷积核大小/feature map大小
记录一下1、Valid 输入图像大小为W * W, filter 大小为 F * F, 步长为 S * S 则之后的图像大小为: (W – F + 1) / S (结果向上取整)2、‘SAME’ 输入图像大小为W * W, filter 大小为 F * F, 步长为 S * S 则之后的图像大小为: W / S (结果向上取整), 具体原理是,在图像周围补零了。...原创 2018-08-06 15:51:16 · 397 阅读 · 0 评论 -
vscode 没有自动切换tensorflow源
背景: vscode 已经被集成在Anaconda中, 可以像其他IDE一样使用,问题\qquadAnaconda下,,原本创建了一个叫做tensorflow_cpu的环境配置了tensorflow cpu版 1.8 。后来电脑装了GPU,,又创建了一个叫做 tensorflow_gpu的环境.配置了tensorflo gpu版 1.9 在这个环境中重新安装了 VSCode。但是...原创 2018-08-01 10:15:45 · 1792 阅读 · 0 评论 -
win10 下采用Anaconda时使用tensorboard的方法
参考:https://blog.csdn.net/hnxyxiaomeng/article/details/78289886配置:win10 + TensorFlow 1.9-gpu+ Anaconda示例程序import tensorflow as tfa = tf.constant(5, name="input_a")b = tf.constant(3, name...原创 2018-08-04 14:48:12 · 1910 阅读 · 1 评论 -
tensorflow: tf.app.run()
转至: https://blog.csdn.net/Suan2014/article/details/76269241学习TensorFlow程序代码时,很多时候可以看到tf.app.run(),下面讲一下该函数的作用和用法。1 函数原型run(main=None, argv=None) Runs the program with an optional 'main' fu...原创 2018-07-30 20:05:54 · 875 阅读 · 0 评论 -
tensorflow学习笔记-----pooling/池化
PoolingThe pooling ops sweep a rectangular window over the input tensor, computing a reduction operation for each window (average, max, or max with argmax). Each pooling op uses rectangular windows ...原创 2018-07-16 09:14:06 · 623 阅读 · 0 评论 -
Stanford CS20学习笔记(2)
Constants, Sequences常量(1)tf.constant ( value, dtype=None, shape=None, name=’Const’, verify_shape=False )import tensorflow as tfa = tf.constant([2,2], name = 'a')b = tf.constant([[0,1],...原创 2018-07-20 19:59:45 · 300 阅读 · 0 评论 -
Stanford CS20学习笔记(1)
Data Flow Graphs(一)TF将 计算的定义与执行分开.具体分为以下两个阶段:创建graph;使会话(session)执行图中的计算;(二)what is Tensor?An n-dimensional array 0-d tensor: scalar (number) 1-d tensor: vector 2-d tensor: matrix ...原创 2018-07-20 10:50:10 · 206 阅读 · 0 评论 -
tensorflow 的 softmax
对于tensorflow中的一些softmax的一些总结softmax的简单说明: [x1,x2,x3]⟶softmax⟶[ex1,ex2,ex3]ex1+ex2+ex3[x1,x2,x3]⟶softmax⟶[ex1,ex2,ex3]ex1+ex2+ex3\left[ x_1,x_2,x_3\right] {\longrightarrow} {softmax} {\longrightarro...原创 2018-07-19 10:46:03 · 652 阅读 · 0 评论 -
tensorflow 随笔记--把向量/vector转换为标量/scalar
numpy中把向量/vector转化为标量/scalar:import numpy as npvec = np.array([1]) #=> [1] 向量scal = np.asscalar(vec)#=> 1 标量tensorflow把向量转化为标量import tensorflow as tfvec = tf.Variable(tf.ones([1])) #=&g...原创 2018-07-24 09:05:36 · 8381 阅读 · 0 评论 -
tensorflow中计算流图的一些性质
目的:想要给tensor中的slice赋值。以numpy为例,对一个np对象,的第二行赋值import numpy as npmat = np.zeros((3, 3))print(mat)""" 输出[[ 0. 0. 0.] [ 0. 0. 0.] [ 0. 0. 0.]]"""mat[1,:] = [1, 2,原创 2018-07-17 08:57:43 · 897 阅读 · 0 评论 -
转-----tensorflow常用函数记录
摘要:本文介绍了tensorflow的常用函数。1、tensorflow常用函数TensorFlow 将图形定义转换成分布式执行的操作, 以充分利用可用的计算资源(如 CPU 或 GPU。一般你不需要显式指定使用 CPU 还是 GPU, TensorFlow 能自动检测。如果检测到 GPU, T...转载 2018-07-17 08:30:40 · 178 阅读 · 0 评论 -
tensorflow学习笔记-----slicing和joining
tensorflow中提供了关于Tensor的组合操作.也就是切片和联合 TensorFlow provides several operations to slice or extract parts of a tensor, or join multiple tensors together. tf.slice 从已有的tensor中,提取出一个slice....原创 2018-07-17 08:08:56 · 888 阅读 · 0 评论 -
Stanford CS20学习笔记(3)
tensorflow中的条件语句假设需要实现Huber loss function, 公式如下: 除非在eager模式下, 否则不能写为 if y - y_pred<delta: (因为流图的性质), 这里面就要用到tf.cond(pred, fn1, fn2, name=None)def huber_loss(labels, predictions, delta=14....原创 2018-08-08 18:52:48 · 289 阅读 · 0 评论