【问题标题】:I need help loading TensorBoard on Mac我需要帮助在 Mac 上加载 TensorBoard
【发布时间】:2019-06-27 05:10:40
【问题描述】:

这是目前与日志记录有关的部分

import tflearn 
from tflearn.layers.conv import conv_2d, max_pool_2d 
from tflearn.layers.core import input_data, dropout, fully_connected 
from tflearn.layers.estimator import regression 

import tensorflow as tf 
tf.reset_default_graph() 

convnet = input_data(shape =[None, WIDTH, HEIGHT, 1], name ='input')
convnet = conv_2d(convnet, 32, 5, activation ='relu') 
convnet = max_pool_2d(convnet, 5) 
convnet = conv_2d(convnet, 64, 5, activation ='relu') 
convnet = max_pool_2d(convnet, 5) 

convnet = conv_2d(convnet, 128, 5, activation ='relu') 
convnet = max_pool_2d(convnet, 5) 

convnet = conv_2d(convnet, 64, 5, activation ='relu') 
convnet = max_pool_2d(convnet, 5) 

convnet = conv_2d(convnet, 32, 5, activation ='relu') 
convnet = max_pool_2d(convnet, 5) 

convnet = fully_connected(convnet, 1024, activation ='relu') 
convnet = dropout(convnet, 0.8) 

convnet = fully_connected(convnet, PATH_TO_NUMBER_OF_CLASSES,       activation ='softmax') 
convnet = regression(convnet, optimizer ='adam', learning_rate = 0.001, 
  loss ='categorical_crossentropy', name ='targets') 

model = tflearn.DNN(convnet,tensorboard_dir = 'log')


#Seperating the image and its label(One Hot Encoder)
#X is the image
#Y is the One Hot
#Therefore, i[0] is the pixel data and i[1] is the label
X = np.array([i[0] for i in train]).reshape(-1, WIDTH, HEIGHT, 1)
Y = [i[1] for i in train]

test_x = np.array([i[0] for i in test]).reshape(-1, WIDTH, HEIGHT, 1)
test_y = [i[1] for i in test]

model.fit({'input': X}, {'targets': Y}, n_epoch=3, validation_set=.    ({'input': test_x}, {'targets': test_y}), 
snapshot_step=500, show_metric=True, run_id='test')

在终端中,我确保我处于 tensorflow 环境中。然后我输入 tensorboard --logdir=/tmp/log

然后我将给定的网址复制并粘贴到浏览器中,它仍然不起作用。

【问题讨论】:

    标签: python macos tensorflow neural-network tensorboard


    【解决方案1】:

    您必须设置详细级别并等于日志目录:

    model = DNN(optimizer, tensorboard_verbose=3, tensorboard_dir='/tmp/tflearn_logs/')
    

    顺便说一下/tmp/tflearn_logs/tensorboard_dir的默认值,所以你不必改变这个参数。

    然后您可以使用以下命令打开板:

    $ tensorboard --logdir='/tmp/tflearn_logs'
    

    来源:http://tflearn.org/getting_started/#visualization

    【讨论】:

      猜你喜欢
      • 2015-07-13
      • 1970-01-01
      • 1970-01-01
      • 2023-01-25
      • 2023-04-08
      • 1970-01-01
      • 2011-06-12
      • 2022-01-04
      • 2020-03-07
      相关资源
      最近更新 更多