컨벌루션 레이어의 필터를 검사하고 싶습니다. 이렇게하려면 세션의 마지막 단계에서 변수를 가져 오려고합니다. 내가 연산을 적용 할 경우, I 오류없이 결과 텐서를 가져올 수 있습니다,세션의 그래프에서 변수를 가져 오는 방법은 무엇입니까?
Fetch argument <tensorflow.python.ops.variables.Variable object at 0x137890710> cannot be interpreted as a Tensor. (Tensor Tensor("conv1_w:0", shape=(5, 5, 1, 16), dtype=float32_ref) is not an element of this graph.)
그러나 다음과 같은 예외를 얻을
graph = tf.Graph()
with graph.as_default():
# Placeholders
...
# Variables.
conv1_w = tf.Variable(..., name='conv1_w')
...
optimizer = ...
accuracy = ...
with tf.Session(graph=graph) as session:
...
acc, c1 = session.run([accuracy, conv1_w], feed_dict=feed_test)
: 여기
단순화 내 모델의 버전입니다 :c1_op = tf.mul(conv1_w,1.0)
optimizer = ...
accuracy = ...
Tensorflow는 변수를 가져올 수 있습니까?
그것은 안 acc, conv_val = session.run ([정확도, conv1_w], feed_dict = feed_test) – Steven
오타되었습니다. 나는 질문을 편집했다 – znat