LoginSignup
21
21

More than 5 years have passed since last update.

TensorFlow入門 - Hello World編

Last updated at Posted at 2016-07-10

Dockerを利用してTensorFlow環境構築

docker run -it -p 8888:8888 --name tensorflow gcr.io/tensorflow/tensorflow

※tensorflowのdockerイメージ構成はここを参考

コンテナに接続

docker exec -it tensorflow /bin/bash

必要なパッケージインストール

apt-get update
apt-get install -y vim wget

Tutorialを参考してhello World出力

#python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>> quit
21
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
21