从谷歌云数据实验室启动张量板

编程入门 行业动态 更新时间:2024-10-25 20:23:05
本文介绍了从谷歌云数据实验室启动张量板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我需要帮助从在 datalab 上运行的 tensorflow 中 luanching tensorboard,我的代码如下(所有内容都在数据实验室中):

I need help in luanching tensorboard from tensorflow running on the datalab, My code is the followings (everything is on the 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

输出是:在端口 6006 上启动 TensorBoard 41(您可以导航到 http://172.17.0.2:6006)

the output is: Starting TensorBoard 41 on port 6006 (You can navigate to http://172.17.0.2:6006)

然而,当我点击链接时,网页是空的

However, when I click on the link, the webpage is empty

请让我知道我错过了什么.我期待看到图表.稍后我想生成更多数据.任何建议表示赞赏.

Please let me know what I am missing. I am expecting to see the graph. later i would like to generate more data. Any suggestion is appreciated.

非常感谢!

推荐答案

如果你使用的是datalab,你可以使用tensorboard如下:

If you are using datalab, you can use tensorboard as below:

from google.datalab.ml import TensorBoard as tb

tb.start('./logs')

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

这篇关于从谷歌云数据实验室启动张量板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 05:43:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1405196.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:张量   实验室   数据   谷歌云

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!