tensorboard使用记录

来源:互联网 发布:全民超神刷钻石软件 编辑:程序博客网 时间:2024/05/21 17:07

最近在学习使用tensorboard

开始用了ipython ,遇到两个坑,记录一下

第一个是:

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'inputs/x_input' with dtype float [[Node: inputs/x_input = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
解决方法是在程序最开始,tf各种调用还没开始之前加一句tf.reset_default_graph()
这样修改以后,代码可以正常把summary相关数据输出到对应的目录中了
但是在运行tensorboard --logdir=xxxx的时候,又出warning:
WARNING:tensorflow:Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more graph events.  Overwriting the graph with the newest event.
同时,生成的tensorboard图很乱.比如只定义了一个w,这里会看到好多w_1,w_2....
google搜了半天未果
最终发现,问题出在ipython上,不太懂ipython 运行机制,但怀疑它有一些并行化的操作? 
结论:tensorboard相关代码不要写在ipython notebook上, 可能会有问题.