Last time, I ran TensorFlow built with the conda command on the Anaconda environment and displayed a graph of the learning status on the TensorBoard.
[TensorFlow] Make IRIS compatible with TensorBoard by changing 3 lines
When building an environment with the conda command on the Anaconda environment, when TensorBoard was operated, the resource could not be found and an error occurred.
WARNING:tensorflow:IOError [Errno 2] No such file or directory: '/home/ubuntu/anaconda3/lib/python3.5/site-packages/tensorflow/tensorboard/webcomponentsjs/webcomponents-lite.min.js' on path /home/ubuntu/anaconda3/lib/python3.5/site-packages/tensorflow/tensorboard/webcomponentsjs/webcomponents-lite.min.js
WARNING:tensorflow:IOError [Errno 2] No such file or directory: '/home/ubuntu/anaconda3/lib/python3.5/site-packages/tensorflow/tensorboard/dist/bazel-html-imports.html' on path /home/ubuntu/anaconda3/lib/python3.5/site-packages/tensorflow/tensorboard/dist/bazel-html-imports.html
WARNING:tensorflow:IOError [Errno 2] No such file or directory: '/home/ubuntu/anaconda3/lib/python3.5/site-packages/external/dist/bazel-html-imports.html' on path /home/ubuntu/anaconda3/lib/python3.5/site-packages/external/dist/bazel-html-imports.html
This may be something you can do by tweaking the environment settings etc., but that eliminates the advantage of TensorFlow, which makes installation easier. I built a TensorFlow environment with pip / pip3 and checked the operation of TensorBord to see if it couldn't be helped.
** Environment **
TensorFlow
** Install TensorFlow with pip **
$ sudo apt-get -y update
$ sudo apt-get -y install python3-pip python-dev
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp35-cp35m-linux_x86_64.whl
$ sudo -H pip3 install --upgrade $TF_BINARY_URL
HelloTensorFlow.py
# -*- coding: utf-8 -*-
"""
Hello TensorFlow
"""
import tensorflow as tf
x = tf.constant(1.0, name='input')
w = tf.Variable(0.8, name='weight')
y = tf.mul(w, x, name='output')
y_ = tf.constant(0.0, name='correct_value')
loss = tf.pow(y - y_, 2, name='loss')
train_step = tf.train.GradientDescentOptimizer(0.025).minimize(loss)
for value in [x, w, y, y_, loss]:
tf.scalar_summary(value.op.name, value)
summaries = tf.merge_all_summaries()
sess = tf.Session()
summary_writer = tf.train.SummaryWriter('log_simple_stats', sess.graph)
sess.run(tf.initialize_all_variables())
for i in range(100):
summary_writer.add_summary(sess.run(summaries), i)
sess.run(train_step)
sess.close()
If you install TensorFlow with pip / pip3, you will not get a resource shortage error even if you access TensorBoard compared to installing TensorFlow with Anaconda. The display of EVENTS and GRAPHS is normal.
** Run TensorFlow program **
$ cd work
$ python3 HelloTensorFlow.py
** Launch TensorBoard **
ubuntu@ip-172-31-24-52:~/work$ tensorboard --logdir=log_simple_stats
** Console log **
ubuntu@ip-172-31-24-52:~/work$ tensorboard --logdir=log_simple_stats
Starting TensorBoard b'29' on port 6006
(You can navigate to http://172.31.24.52:6006)
[03/Nov/2016 14:35:46] "GET / HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /webcomponentsjs/webcomponents-lite.min.js HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /lib/css/global.css HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] code 404, message Not Found
[03/Nov/2016 14:35:46] "GET /dist/bazel-html-imports.html HTTP/1.1" 404 -
[03/Nov/2016 14:35:46] "GET /dist/tf-tensorboard.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /polymer/polymer.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /iron-icons/iron-icons.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /paper-tabs/paper-tabs.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /paper-dialog/paper-dialog.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:46] "GET /paper-checkbox/paper-checkbox.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:47] "GET /paper-toolbar/paper-toolbar.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:47] "GET /paper-button/paper-button.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:47] "GET /paper-header-panel/paper-header-panel.html HTTP/1.1" 200 -
[03/Nov/2016 14:35:47] "GET /polymer/polymer-mini.html HTTP/1.1" 200 -
・ ・ ・
```
GRAPHS
EVENTS
TensorFlow should be installed and used with pip / pip3.
Recommended Posts