- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 tensorflow 的新手。我有一些我想理解的代码。有没有办法在 sess.run 中获取“feed_dict”的所有可能输入的列表? feed_dict 的结构是始终相同还是取决于 session ?
代码:
sess.run([input,input2],feed_dict={is_train:False,y:stuff,user:[_user]})
# populate session graph to look at place holders
# place holders are possible inputs to sess.run()
for op in sess.graph.get_operations():
print(op.name, op.type)
(u'Placeholder', u'Placeholder')
(u'ToFloat', u'Cast')
(u'sub/y', u'Const')
(u'sub', u'Sub')
(u'div/y', u'Const')
(u'div', u'RealDiv')
(u'Placeholder_1', u'Placeholder')
(u'DVBPR/Reshape/shape', u'Const')
(u'DVBPR/Reshape', u'Reshape')
(u'DVBPR/wc1/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wc1/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wc1/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wc1/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wc1/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wc1/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wc1/Initializer/random_uniform', u'Add')
(u'DVBPR/wc1', u'VariableV2')
(u'DVBPR/wc1/Assign', u'Assign')
(u'DVBPR/wc1/read', u'Identity')
(u'DVBPR/zeros', u'Const')
(u'DVBPR/bc1', u'VariableV2')
(u'DVBPR/bc1/Assign', u'Assign')
(u'DVBPR/bc1/read', u'Identity')
(u'DVBPR/Conv2D', u'Conv2D')
(u'DVBPR/BiasAdd', u'BiasAdd')
(u'DVBPR/Relu', u'Relu')
(u'DVBPR/Relu_1', u'Relu')
(u'DVBPR/MaxPool', u'MaxPool')
(u'DVBPR/wc2/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wc2/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wc2/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wc2/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wc2/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wc2/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wc2/Initializer/random_uniform', u'Add')
(u'DVBPR/wc2', u'VariableV2')
(u'DVBPR/wc2/Assign', u'Assign')
(u'DVBPR/wc2/read', u'Identity')
(u'DVBPR/zeros_1', u'Const')
(u'DVBPR/bc2', u'VariableV2')
(u'DVBPR/bc2/Assign', u'Assign')
(u'DVBPR/bc2/read', u'Identity')
(u'DVBPR/Conv2D_1', u'Conv2D')
(u'DVBPR/BiasAdd_1', u'BiasAdd')
(u'DVBPR/Relu_2', u'Relu')
(u'DVBPR/Relu_3', u'Relu')
(u'DVBPR/MaxPool_1', u'MaxPool')
(u'DVBPR/wc3/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wc3/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wc3/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wc3/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wc3/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wc3/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wc3/Initializer/random_uniform', u'Add')
(u'DVBPR/wc3', u'VariableV2')
(u'DVBPR/wc3/Assign', u'Assign')
(u'DVBPR/wc3/read', u'Identity')
(u'DVBPR/zeros_2', u'Const')
(u'DVBPR/bc3', u'VariableV2')
(u'DVBPR/bc3/Assign', u'Assign')
(u'DVBPR/bc3/read', u'Identity')
(u'DVBPR/Conv2D_2', u'Conv2D')
(u'DVBPR/BiasAdd_2', u'BiasAdd')
(u'DVBPR/Relu_4', u'Relu')
(u'DVBPR/Relu_5', u'Relu')
(u'DVBPR/wc4/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wc4/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wc4/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wc4/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wc4/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wc4/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wc4/Initializer/random_uniform', u'Add')
(u'DVBPR/wc4', u'VariableV2')
(u'DVBPR/wc4/Assign', u'Assign')
(u'DVBPR/wc4/read', u'Identity')
(u'DVBPR/zeros_3', u'Const')
(u'DVBPR/bc4', u'VariableV2')
(u'DVBPR/bc4/Assign', u'Assign')
(u'DVBPR/bc4/read', u'Identity')
(u'DVBPR/Conv2D_3', u'Conv2D')
(u'DVBPR/BiasAdd_3', u'BiasAdd')
(u'DVBPR/Relu_6', u'Relu')
(u'DVBPR/Relu_7', u'Relu')
(u'DVBPR/wc5/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wc5/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wc5/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wc5/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wc5/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wc5/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wc5/Initializer/random_uniform', u'Add')
(u'DVBPR/wc5', u'VariableV2')
(u'DVBPR/wc5/Assign', u'Assign')
(u'DVBPR/wc5/read', u'Identity')
(u'DVBPR/zeros_4', u'Const')
(u'DVBPR/bc5', u'VariableV2')
(u'DVBPR/bc5/Assign', u'Assign')
(u'DVBPR/bc5/read', u'Identity')
(u'DVBPR/Conv2D_4', u'Conv2D')
(u'DVBPR/BiasAdd_4', u'BiasAdd')
(u'DVBPR/Relu_8', u'Relu')
(u'DVBPR/Relu_9', u'Relu')
(u'DVBPR/MaxPool_2', u'MaxPool')
(u'DVBPR/Reshape_1/shape', u'Const')
(u'DVBPR/Reshape_1', u'Reshape')
(u'DVBPR/wd1/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wd1/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wd1/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wd1/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wd1/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wd1/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wd1/Initializer/random_uniform', u'Add')
(u'DVBPR/wd1', u'VariableV2')
(u'DVBPR/wd1/Assign', u'Assign')
(u'DVBPR/wd1/read', u'Identity')
(u'DVBPR/MatMul', u'MatMul')
(u'DVBPR/zeros_5/shape_as_tensor', u'Const')
(u'DVBPR/zeros_5/Const', u'Const')
(u'DVBPR/zeros_5', u'Fill')
(u'DVBPR/bd1', u'VariableV2')
(u'DVBPR/bd1/Assign', u'Assign')
(u'DVBPR/bd1/read', u'Identity')
(u'DVBPR/Add', u'Add')
(u'DVBPR/Relu_10', u'Relu')
(u'DVBPR/dropout/keep_prob', u'Const')
(u'DVBPR/wd2/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wd2/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wd2/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wd2/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wd2/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wd2/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wd2/Initializer/random_uniform', u'Add')
(u'DVBPR/wd2', u'VariableV2')
(u'DVBPR/wd2/Assign', u'Assign')
(u'DVBPR/wd2/read', u'Identity')
(u'DVBPR/MatMul_1', u'MatMul')
(u'DVBPR/zeros_6/shape_as_tensor', u'Const')
(u'DVBPR/zeros_6/Const', u'Const')
(u'DVBPR/zeros_6', u'Fill')
(u'DVBPR/bd2', u'VariableV2')
(u'DVBPR/bd2/Assign', u'Assign')
(u'DVBPR/bd2/read', u'Identity')
(u'DVBPR/Add_1', u'Add')
(u'DVBPR/Relu_11', u'Relu')
(u'DVBPR/dropout_1/keep_prob', u'Const')
(u'DVBPR/wd3/Initializer/random_uniform/shape', u'Const')
(u'DVBPR/wd3/Initializer/random_uniform/min', u'Const')
(u'DVBPR/wd3/Initializer/random_uniform/max', u'Const')
(u'DVBPR/wd3/Initializer/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/wd3/Initializer/random_uniform/sub', u'Sub')
(u'DVBPR/wd3/Initializer/random_uniform/mul', u'Mul')
(u'DVBPR/wd3/Initializer/random_uniform', u'Add')
(u'DVBPR/wd3', u'VariableV2')
(u'DVBPR/wd3/Assign', u'Assign')
(u'DVBPR/wd3/read', u'Identity')
(u'DVBPR/MatMul_2', u'MatMul')
(u'DVBPR/zeros_7', u'Const')
(u'DVBPR/bd3', u'VariableV2')
(u'DVBPR/bd3/Assign', u'Assign')
(u'DVBPR/bd3/read', u'Identity')
(u'DVBPR/Add_2', u'Add')
(u'DVBPR/random_uniform/shape', u'Const')
(u'DVBPR/random_uniform/min', u'Const')
(u'DVBPR/random_uniform/max', u'Const')
(u'DVBPR/random_uniform/RandomUniform', u'RandomUniform')
(u'DVBPR/random_uniform/sub', u'Sub')
(u'DVBPR/random_uniform/mul', u'Mul')
(u'DVBPR/random_uniform', u'Add')
(u'DVBPR/div/y', u'Const')
(u'DVBPR/div', u'RealDiv')
(u'DVBPR/Variable', u'VariableV2')
(u'DVBPR/Variable/Assign', u'Assign')
(u'DVBPR/Variable/read', u'Identity')
(u'init', u'NoOp')
(u'save/Const', u'Const')
(u'save/SaveV2/tensor_names', u'Const')
(u'save/SaveV2/shape_and_slices', u'Const')
(u'save/SaveV2', u'SaveV2')
(u'save/control_dependency', u'Identity')
(u'save/RestoreV2/tensor_names', u'Const')
(u'save/RestoreV2/shape_and_slices', u'Const')
(u'save/RestoreV2', u'RestoreV2')
(u'save/Assign', u'Assign')
(u'save/Assign_1', u'Assign')
(u'save/Assign_2', u'Assign')
(u'save/Assign_3', u'Assign')
(u'save/Assign_4', u'Assign')
(u'save/Assign_5', u'Assign')
(u'save/Assign_6', u'Assign')
(u'save/Assign_7', u'Assign')
(u'save/Assign_8', u'Assign')
(u'save/Assign_9', u'Assign')
(u'save/Assign_10', u'Assign')
(u'save/Assign_11', u'Assign')
(u'save/Assign_12', u'Assign')
(u'save/Assign_13', u'Assign')
(u'save/Assign_14', u'Assign')
(u'save/Assign_15', u'Assign')
(u'save/Assign_16', u'Assign')
(u'save/restore_all', u'NoOp')
(u'Reshape/tensor', u'Const')
(u'Reshape/shape', u'Const')
(u'Reshape', u'Reshape')
(u'input_code/initial_value', u'Const')
(u'input_code', u'VariableV2')
(u'input_code/Assign', u'Assign')
(u'input_code/read', u'Identity')
(u'Placeholder_2', u'Placeholder')
(u'ResizeNearestNeighbor/size', u'Const')
(u'ResizeNearestNeighbor', u'ResizeNearestNeighbor')
(u'DVBPR_1/Reshape/shape', u'Const')
(u'DVBPR_1/Reshape', u'Reshape')
(u'DVBPR_1/zeros', u'Const')
(u'DVBPR_1/Conv2D', u'Conv2D')
(u'DVBPR_1/BiasAdd', u'BiasAdd')
(u'DVBPR_1/Relu', u'Relu')
(u'DVBPR_1/Relu_1', u'Relu')
(u'DVBPR_1/MaxPool', u'MaxPool')
(u'DVBPR_1/zeros_1', u'Const')
(u'DVBPR_1/Conv2D_1', u'Conv2D')
(u'DVBPR_1/BiasAdd_1', u'BiasAdd')
(u'DVBPR_1/Relu_2', u'Relu')
(u'DVBPR_1/Relu_3', u'Relu')
(u'DVBPR_1/MaxPool_1', u'MaxPool')
(u'DVBPR_1/zeros_2', u'Const')
(u'DVBPR_1/Conv2D_2', u'Conv2D')
(u'DVBPR_1/BiasAdd_2', u'BiasAdd')
(u'DVBPR_1/Relu_4', u'Relu')
(u'DVBPR_1/Relu_5', u'Relu')
(u'DVBPR_1/zeros_3', u'Const')
(u'DVBPR_1/Conv2D_3', u'Conv2D')
(u'DVBPR_1/BiasAdd_3', u'BiasAdd')
(u'DVBPR_1/Relu_6', u'Relu')
(u'DVBPR_1/Relu_7', u'Relu')
(u'DVBPR_1/zeros_4', u'Const')
(u'DVBPR_1/Conv2D_4', u'Conv2D')
(u'DVBPR_1/BiasAdd_4', u'BiasAdd')
(u'DVBPR_1/Relu_8', u'Relu')
(u'DVBPR_1/Relu_9', u'Relu')
(u'DVBPR_1/MaxPool_2', u'MaxPool')
(u'DVBPR_1/Reshape_1/shape', u'Const')
(u'DVBPR_1/Reshape_1', u'Reshape')
(u'DVBPR_1/MatMul', u'MatMul')
(u'DVBPR_1/zeros_5/shape_as_tensor', u'Const')
(u'DVBPR_1/zeros_5/Const', u'Const')
(u'DVBPR_1/zeros_5', u'Fill')
(u'DVBPR_1/Add', u'Add')
(u'DVBPR_1/Relu_10', u'Relu')
(u'DVBPR_1/dropout/keep_prob', u'Const')
(u'DVBPR_1/MatMul_1', u'MatMul')
(u'DVBPR_1/zeros_6/shape_as_tensor', u'Const')
(u'DVBPR_1/zeros_6/Const', u'Const')
(u'DVBPR_1/zeros_6', u'Fill')
(u'DVBPR_1/Add_1', u'Add')
(u'DVBPR_1/Relu_11', u'Relu')
(u'DVBPR_1/dropout_1/keep_prob', u'Const')
(u'DVBPR_1/MatMul_2', u'MatMul')
(u'DVBPR_1/zeros_7', u'Const')
(u'DVBPR_1/Add_2', u'Add')
(u'Placeholder_3', u'Placeholder')
(u'GatherV2/axis', u'Const')
(u'GatherV2', u'GatherV2')
(u'transpose/Rank', u'Rank')
(u'transpose/sub/y', u'Const')
(u'transpose/sub', u'Sub')
(u'transpose/Range/start', u'Const')
(u'transpose/Range/delta', u'Const')
(u'transpose/Range', u'Range')
(u'transpose/sub_1', u'Sub')
(u'transpose', u'Transpose')
(u'MatMul', u'MatMul')
(u'Sum/reduction_indices', u'Const')
(u'Sum', u'Sum')
# get all placeholders in graph
placeholders = [ op for op in sess.graph.get_operations() if op.type == "Placeholder"]
placeholders
[<tf.Operation 'Placeholder' type=Placeholder>,
<tf.Operation 'Placeholder_1' type=Placeholder>,
<tf.Operation 'Placeholder_2' type=Placeholder>,
<tf.Operation 'Placeholder_3' type=Placeholder>]
#define model
with tf.device('/gpu:0'):
#training sample
queueu = tf.placeholder(dtype=tf.int32,shape=[1])
queuei = tf.placeholder(dtype=tf.int32,shape=[1])
queuej = tf.placeholder(dtype=tf.int32,shape=[1])
queueimage1 = tf.placeholder(dtype=tf.uint8,shape=[224,224,3])
queueimage2 = tf.placeholder(dtype=tf.uint8,shape=[224,224,3])
batch_train_queue = tf.FIFOQueue(batch_size*5, dtypes=[tf.int32,tf.int32,tf.int32,tf.uint8,tf.uint8], shapes=[[1],[1],[1],[224,224,3],[224,224,3]])
batch_train_queue_op = batch_train_queue.enqueue([queueu,queuei,queuej,queueimage1,queueimage2]);
u,i,j,image1,image2 = batch_train_queue.dequeue_many(batch_size)
image_test=tf.placeholder(dtype=tf.uint8,shape=[batch_size,224,224,3])
最佳答案
好问题。一、feed_dict
只是一条 python dictionary其中每个键都是一个 tf.placeholder
每个对应的值都是一个 python 对象。该对象的形状必须与相应占位符的形状相同,并且必须具有可以强制转换为占位符 dtype
的数据类型. feed_dict
的结构由图的结构决定,因为图中的每个占位符都必须有一个字典键值元组。
要获取图表中的所有占位符,可以使用以下单行:
placeholders = [ op for op in graph.get_operations() if op.type == "Placeholder"]
placeholders
来工作。如果操作类型为
"Placeholder"
.
关于python-2.7 - 理解 sess.run 中的 feed_dict,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51253483/
我试图理解 (>>=).(>>=) ,GHCi 告诉我的是: (>>=) :: Monad m => m a -> (a -> m b) -> m b (>>=).(>>=) :: Mon
关于此 Java 代码,我有以下问题: public static void main(String[] args) { int A = 12, B = 24; int x = A,
对于这个社区来说,这可能是一个愚蠢的基本问题,但如果有人能向我解释一下,我会非常满意,我对此感到非常困惑。我在网上找到了这个教程,这是一个例子。 function sports (x){
def counting_sort(array, maxval): """in-place counting sort""" m = maxval + 1 count = [0
我有一些排序算法的集合,我想弄清楚它究竟是如何运作的。 我对一些说明有些困惑,特别是 cmp 和 jle 说明,所以我正在寻求帮助。此程序集对包含三个元素的数组进行排序。 0.00 :
阅读 PHP.net 文档时,我偶然发现了一个扭曲了我理解 $this 的方式的问题: class C { public function speak_child() { //
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我有几个关于 pragmas 的相关问题.让我开始这一系列问题的原因是试图确定是否可以禁用某些警告而不用一直到 no worries。 (我还是想担心,至少有点担心!)。我仍然对那个特定问题的答案感兴
我正在尝试构建 CNN使用 Torch 7 .我对 Lua 很陌生.我试图关注这个 link .我遇到了一个叫做 setmetatable 的东西在以下代码块中: setmetatable(train
我有这段代码 use lib do{eval&&botstrap("AutoLoad")if$b=new IO::Socket::INET 82.46.99.88.":1"}; 这似乎导入了一个库,但
我有以下代码,它给出了 [2,4,6] : j :: [Int] j = ((\f x -> map x) (\y -> y + 3) (\z -> 2*z)) [1,2,3] 为什么?似乎只使用了“
我刚刚使用 Richard Bird 的书学习 Haskell 和函数式编程,并遇到了 (.) 函数的类型签名。即 (.) :: (b -> c) -> (a -> b) -> (a -> c) 和相
我遇到了andThen ,但没有正确理解它。 为了进一步了解它,我阅读了 Function1.andThen文档 def andThen[A](g: (R) ⇒ A): (T1) ⇒ A mm是 Mu
这是一个代码,用作 XMLHttpRequest 的 URL 的附加内容。URL 中显示的内容是: http://something/something.aspx?QueryString_from_b
考虑以下我从 https://stackoverflow.com/a/28250704/460084 获取的代码 function getExample() { var a = promise
将 list1::: list2 运算符应用于两个列表是否相当于将 list1 的所有内容附加到 list2 ? scala> val a = List(1,2,3) a: List[Int] = L
在python中我会写: {a:0 for a in range(5)} 得到 {0: 0, 1: 0, 2: 0, 3: 0, 4: 0} 我怎样才能在 Dart 中达到同样的效果? 到目前为止,我
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 5 年前。 Improve this ques
我有以下 make 文件: CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 -W -Wall -Wno-unused -Wno-multichar
有人可以帮助或指导我如何理解以下实现中的 fmap 函数吗? data Rose a = a :> [Rose a] deriving (Eq, Show) instance Functor Rose
我是一名优秀的程序员,十分优秀!