LoginSignup
0
3

More than 5 years have passed since last update.

(初心者向け)TensorFlowを動かしてみる

Last updated at Posted at 2017-09-03

MacbookでTensorFlowでAIを使ってみよう、という企画です
Macbookなど稼働環境の能力に余裕が無い場合には、他のアプリケーションを停止してから実行します

1. TensorFlowのGettingStartedを読む

2. Jupyter Notebookを使ってTensorFlowのサンプルを動かしてみる

-Jupyter Notebookを使ってTensorFlowのサンプルを動かします。

2.1 Jupyter Notebookを使ってPythonの基本を確認する

-githubのtensorflow getting startedサンプルを開き、画面右上の緑の「Download ZIP」ボタンを押してzipファイルをダウンロードします

スクリーンショット 2017-09-03 13.21.06.png

スクリーンショット 2017-09-03 13.21.49.png

  • TensorFlow仮想環境をactivateしていない((tf)プロンプトが表示されていない)場合、source tf/bin/activateでTensorFlow用の仮想環境をactivateします。プロンプトに(tf)が表示されます
TensorFlow用仮想環境をactivateする
MacBook-Pro:tftest tohru$ source tf/bin/activate
(tf) MacBook-Pro:tftest tohru$ 

  • jupyter notebookと入力し、jupyter notebookを起動させます。
  • jupyterを未インストールの場合、Python2.x 環境であればpip install jupyterで、Python3.x環境であればpip3 install jupyterででインストールします
(tf) MacBook-Pro:python_exercise-master tohru$ pwd
/Users/tohru/Desktop/tftest/tensorflow_getting_started-master
(tf) MacBook-Pro:python_exercise-master tohru$ ls
1. Python_Exercise.ipynb        3. tensorflow_getting_started.ipynb
2. Matplotlib_Exercise.ipynb
(tf) MacBook-Pro:python_exercise-master tohru$ jupyter notebook

  • Jupyter notebookのメニューが表示されるので、「1. Python_Exercise.ipynb」を選択して実行します。 スクリーンショット 2017-09-03 13.25.29.png

2.2 Jupyter notebookを使ってMatplotlibの基本的な使い方を確認する

  • 前項と同様にjupyter notebookを実行し、「2. Matplotlib_Exercise.ipynb」を選択して実行します。

2.3 Jupyter notebookを使ってTensorFlow Getting Startedのサンプルを動かしてみる

  • 前項と同様にjupyter notebookを実行し、「3. tensorflow_getting_started.ipynb」を選択して実行します。
0
3
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
0
3