3
からtensorboardを起動し、 私のコードは、以下の(すべてがdatalabである)である:私はdatalab上で実行されているtensorflowからtensorboardをluanchingで助けを必要とするGoogleのクラウド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を開始ポート6006 上の41(あなたがhttp://172.17.0.2:6006に移動することができます)
私はリンクをクリックしたときただし、Webページは私が自演せてください
空でありますw私が逃しているもの。私はグラフを見ることを期待しています。後で私はより多くのデータを生成したいと思います。どんな提案も感謝しています。
多くの感謝!あなたがdatalabを使用している場合
を私は、ポート6006のネットワークルールを追加しようとした:のgcloudベータ計算ファイアウォール・ルールはtensorboard --actionできるよう作成 - rules tcp:6006とhttp://:6006でも、どちらもうまくいきませんでした。なにか提案を? –
eilalan