![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tensorflow
noirblack
这个作者很懒,什么都没留下…
展开
-
Tensorflow 多GPU下,指定使用某一块GPU, 多块, 禁用
如果机器中有多块GPU,tensorflow会默认吃掉所有能用的显存, 如果实验室多人公用一台服务器,希望指定使用特定某块GPU。 可以在文件开头加入如下代码:import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "1"指定使用第二块GPU(从0开始)原创 2017-04-26 11:49:32 · 19971 阅读 · 1 评论 -
Tensorflow: 从checkpoint文件中读取tensor
在使用pre-train model时候,我们需要restore variables from checkpoint files. 经出现在checkpoint 中找不到”Tensor name not found”. 这时候需要查看一下ckpt中到底有哪些变量from tensorflow.python import pywrap_tensorflow checkpoint_path = os原创 2017-05-08 20:10:46 · 17613 阅读 · 10 评论 -
TensorFlow Serving,GPU版安装
TensorFlow Serving,GPUTensorflow serving 是一个开源的工具,主要用来部署训练好的模型,进行Inference。 Tensorflow serving Github地址 本文主要介绍tensorflow serving的安装,支持GPU模型。安装依赖BazelTensorFlow Serving 要求0.4.5以上的Bazel。Bazel 的安装说明her原创 2017-07-06 16:14:23 · 8259 阅读 · 1 评论 -
TensorFlow 排序,ranking
计算 ranking loss 时候可能需要对 tensor 进行排序和获取对应的index, 下面介绍用两个TF的函数完成获取从小到大index的方法:有一个 tensor,[9, 4, 5], 想得到它从小到大的排序的index [1, 2, 0] TF中有函数 tf.nn.top_k(·) 和tf.reverse(·)完成import tensorflow as tf a = tf.con原创 2017-09-25 20:13:46 · 8188 阅读 · 1 评论 -
Ubuntu 源码编译安装 GPU版 TensorFlow
- 从github下载 Tensorflow 源码$ git clone https://github.com/tensorflow/tensorflow 查看当前分支, 根据需求切换到指定分支, e.g. r1.3$ cd tensorflow $ git checkout Branch # where Branch is the desired branch $ git checkout r1.原创 2017-09-14 16:58:43 · 582 阅读 · 0 评论 -
TensorFlow系列: tf.shape() 与 tensor.get_shape()
tf.shape() shape( input, name=None, out_type=tf.int32 ) 返回一个代表 input 的 shape 的 1-D tensor. 也就是说获得shape的信息,需要用sess.run(). >>> import tensorflow as tf >&a原创 2018-05-15 18:59:48 · 7228 阅读 · 0 评论