2016-06-09 4 views
3

나는 tensorflow 나선형 데이터 세트의 예제 코드를 시도하고 신경 네트워크를 구축했습니다. 나는 네트워크의 그래픽 구조를 시각화하고 싶었다. PFB 코드를 시도했습니다.어떻게 tensorflow 신경 네트워크 개체를 그릴

with tf.Graph().as_default(): 
    net = tflearn.input_data([None, 2]) 
    net = tflearn.fully_connected(net,6, 
       activation='tanh',weights_init='normal') 
    print(net) 

답변

3

그래프를 시각화하려면 TensorBoard를 사용해야합니다. 사용 방법은 tutorial입니다.

코드 끝 부분에 요약 작성자를 추가 할 수 있습니다. 요약 작성자는 주어진 위치에 그래프의 시각화를 포함하는 이벤트 파일을 작성합니다.

graph = tf.Graph() 
with graph.as_default(): 
    net = tflearn.input_data([None, 2]) 
    net = tflearn.fully_connected(net,6, 
       activation='tanh',weights_init='normal') 

sess = tf.Session(graph=graph) 
writer = tf.train.SummaryWriter('tmp/tensorboard_log', sess.graph) 

은 그럼 그냥 tensorboard --logdir tmp/tensorboard_log를 실행하고 localhost:6006/#graphs에 브라우저에서 이동해야합니다.

+0

"http : // localhost : 6006/# graphs"-이 링크에는 그래프가 표시되지 않습니다. –

+0

"그래프 정의 파일을 찾을 수 없습니다."대신이 오류가 발생합니다 –

+0

'tmp/tensorboard_log'에 이벤트 파일이 있습니까? –