เปิดตัวเทนเซอร์บอร์ดจาก google cloud datalab

ฉันต้องการความช่วยเหลือในการเปิดเทนเซอร์บอร์ดจากเทนเซอร์โฟลว์ที่ทำงานบนดาต้าแล็บ รหัสของฉันมีดังต่อไปนี้ (ทุกอย่างอยู่บนดาต้าแล็บ):

import tensorflow as tf

with tf.name_scope('input'):
  print ("X_np")
  X_np = tf.placeholder(tf.float32, shape=[None, num_of_features],name="input")

with tf.name_scope('weights'):
  print ("W is for weights & - 15 number of diseases")
  W = tf.Variable(tf.zeros([num_of_features,15]),name="W")

with tf.name_scope('biases'):
  print ("b")
  #todo:authemate for more diseases
  b = tf.Variable(tf.zeros([15]),name="biases")

with tf.name_scope('layer'):
  print ("y_train_np")
  y_train_np = tf.nn.softmax(tf.matmul(X_np,W) + b)

with tf.name_scope('correct'):
  print ("y_ - placeholder for correct answer")
  y_ = tf.placeholder(tf.float32, shape=[None, 15],name="correct_answer")

with tf.name_scope('loss'):
  print ("cross entrpy")
  cross_entropy = -tf.reduce_sum(y_*tf.log(y_train_np))

# % of correct answers found in batch
print("is correct")
is_correct = tf.equal(tf.argmax(y_train_np,1),tf.argmax(y_,1))
print("accuracy")
accuracy = tf.reduce_mean(tf.cast(is_correct,tf.float32))

print("train step")
train_step = tf.train.GradientDescentOptimizer(0.01).minimize(cross_entropy)
# train data and get results for batches
print("initialize all varaible")
init = tf.global_variables_initializer()

print("session")
sess = tf.Session()
writer = tf.summary.FileWriter("logs/", sess.graph)
init = tf.global_variables_initializer()
sess.run(init)

!tensorboard --logdir=/logs

ผลลัพธ์คือ: การเริ่มต้น TensorBoard 41 บนพอร์ต 6006 (คุณสามารถนำทางไปยัง http://172.17.0.2:6006)

แต่เมื่อฉันคลิกลิงก์ หน้าเว็บก็ว่างเปล่า

โปรดแจ้งให้เราทราบสิ่งที่ฉันหายไป ฉันหวังว่าจะเห็นกราฟ ในภายหลังฉันต้องการสร้างข้อมูลเพิ่มเติม ข้อเสนอแนะใด ๆ ที่ชื่นชม

ขอบคุณมาก!


person eilalan    schedule 12.07.2017    source แหล่งที่มา
comment
ฉันพยายามเพิ่มกฎเครือข่ายสำหรับพอร์ต 6006: gcloud beta compute firewall-rules create tensorboard --actionallow --rules tcp:6006 และ http://‹public ip›:6006 แต่ก็ไม่ได้ผลเช่นกัน ข้อเสนอแนะใด ๆ ?   -  person eilalan    schedule 12.07.2017


คำตอบ (2)


หากคุณใช้ datalab คุณสามารถใช้เทนเซอร์บอร์ดได้ดังนี้:

from google.datalab.ml import TensorBoard as tb

tb.start('./logs')

http://googledatalab.github.io/pydatalab/google.datalab.ml.html

person 이승훈    schedule 18.09.2017
comment
สิ่งนี้ทำให้ฉันมี ModuleNotFoundError: ไม่มีโมดูลชื่อ 'google.datalab' :/ ในตอนนี้ (มี.ค. 20) - person Tombas; 30.03.2020

คุณยังสร้างอินสแตนซ์ Cloud AI Platform Notebook ที่รองรับ TensorBoard ได้โดยป้อนคำสั่งต่อไปนี้ลงใน Cloud Shell หลังจากนั้นคุณสามารถเปิดเทนเซอร์บอร์ดเมื่อคุณต้องการจากตัวเรียกใช้งาน (ไฟล์ -> ตัวเรียกใช้ใหม่ -> เทนเซอร์บอร์ด)

export IMAGE_FAMILY="tf-1-14-cpu"
export ZONE="us-west1-b"
export INSTANCE_NAME="tf-tensorboard-1"
export INSTANCE_TYPE="n1-standard-4"
gcloud compute instances create "${INSTANCE_NAME}" \
        --zone="${ZONE}" \
        --image-family="${IMAGE_FAMILY}" \
        --image-project=deeplearning-platform-release \
        --machine-type="${INSTANCE_TYPE}" \
        --boot-disk-size=200GB \
        --scopes=https://www.googleapis.com/auth/cloud-platform \
        --metadata="proxy-mode=project_editors
person Tujamo    schedule 01.01.2020