2017-03-04 1 views

답변

1

제 제안은 세션이 어떤 그래프를 실행하고 있는지 확인하는 것입니다. 첫째

  1. 빌드 그래프와 세션에 그래프를 전달 : 당신이 시도 할 수 일도 있습니다. 당신은 여러 with 문을 사용하여 중첩 된 방식으로 사용하려는 경우

    myGraph = tf.Graph() 
    with myGraph.as_default(): 
        # build your graph here 
    
    mySession = tf.Session(graph=myGraph) 
    mySession.run(...) 
    
    # Or 
    
    with tf.Session(graph=myGraph) as mySession: 
        mySession.run(...) 
    
  2. .

    with tf.Graph().as_default(): 
        # build your graph here 
        with tf.Session() as mySession: 
         mySession.run(...) 
    
관련 문제