2017/8/24 update tensorflow 1.3.0 was released on 8/22 and 1.4.0 was released on 8/23. (Github RELEASE.md page) As of 8/24, the whl file is 1.3 in "Installing TensorFlow on Windows \ | TensorFlow" on the official TensorFlow website.
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.3.0-cp35-cp35m-win_amd64.whl
Since 1.4.0 is released soon after 1.3.0 is released, the whl file is likely to be updated soon. Please check the latest information on the official website ☆ 彡
--I want to analyze data with Jupyter Notebook --I want to use TensorFlow directly on Windows --Specify the primary source
Follow the "Installing TensorFlow on Windows" page on the official TensorFlow website.
Select and install Python 3.6 version 64-Bit (437 MB) from the Anaconda download page. Basically, it is OK if you follow the installer, but it is recommended that the Install Location is a short path (for example, C: \ Anaconda3).
Launch Anaconda Navigator after the installation is complete.
Click "Environments" in the left pane of Anaconda Navigator to see a list of virtual environments managed by Anaconda. By default, there is only an environment called root. Create an environment for TensorFlow here. When you press the "Create" button at the bottom of the list, a dialog will be displayed. Enter an arbitrary environment name (example: tensorflow) and set the Python version to 3.5 to create. As an aside, it shows where the entity of the environment created at Location is.
The created tensorflow is displayed in the list of Environments. When you click on the created tensorflow, a triangle button "▶" will be displayed. Click it, and then click "Open Terminal" from the displayed menu.
This will launch a command prompt window. Make sure that the prompt starts with (~ tensorflow).
In this command prompt window (Terminal window), you can find it in "Installing with Anaconda" on the official TensorFlow "Installing TensorFlow on Windows" (https://www.tensorflow.org/install/install_windows) page. Run the command to install TensorFlow. (Note) The whl file will change with the TensorFlow version upgrade! Please be sure to check the above page and copy from there.
For CPU only.
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl
If it is executed without any error, check the operation. Type python in this Terminal window, type import tensorflow in interpreter mode, and if no error occurs, it's OK. Exit interpreter mode with quit (). (The window remains the same)
If you look at Project Jupyter's official website, it says "For new users, we highly recommend installing Anaconda." Jupyter Notebook is installed from the beginning in Anaconda's default environment (root). Since Jupyter Notebook is not installed in the newly created tensorflow environment, the following command in the above Terminal window based on the Jupyter :: Anaconda Cloud page To install.
(tensorflow)> conda install -c anaconda jupyter
If you use the conda command for package management provided by Anaconda, related packages will be included in a batch. When you execute the above command, a list of related packages will be displayed and you will be asked to confirm it. Enter y to install it.
By the way, running the conda list command will list the packages installed in your environment. With pip list, only pip install will be displayed.
If you type> jupyter notebook in the Terminal window, the Jupyter Notebook process will start and the browser will start. It is OK if the screen below is displayed on the browser!
The URL of JupyterNotebook is http: // localhost: 8888, so if you are in a proxy environment, check "Do not use a proxy server for local addresses" in "Windows Control Panel> Internet Options> Connections> LAN Settings". Please keep it.
An indispensable part of Jupyter Notebook is the visualization tool Matplotlib. If you look at the Matplotlib official HP installation page, Anaconda is introduced as an Installing pre-built package. Based on Matplotlib :: Anaconda Cloud, install it with the conda install command in the Terminal window in the same way as installing Jupyter Notebook. If Jupyter Notebook is running in the Terminal window, open a new Terminal in the tensorflow environment from Anaconda Navigator, or press Ctrl + C in the Terminal window where Jupyter Notebook is running to stop and run the Jupyter Notebook process. please.
(tensorflow)> conda install -c anaconda matplotlib
It will install the related packages as you did with Jupyter Notebook.
After installing, let's check the operation with Jupyter Notebook. Launch Jupyter Notebook and select "New"> "Python3" in the upper right corner.
Then, in a new window (tab), enter the following code in the editor part (the part called In []) and press the run button at the top. It is OK if the scatter plot is displayed as shown below.
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
#Random coordinates(x,y)To generate 10
x = np.random.randn(10)
y = np.random.randn(10)
print(x)
print(y)
#Draw a scatter plot
plt.plot(x,y,'o')
plt.xlabel("x")
plt.ylabel("y")
By the way, what is displayed on the Jupyter Notebook screen of the browser ("Contacts", "Desktop", etc.) is a list of files and folders of the folder where the jupyter notebook command was executed in the Terminal window. Therefore, when starting Jupyter Notebook, it is a good idea to create a working folder for Jupyter Notebook, cd to the working directory in the Terminal window, and then start it. It's a hassle to start Anaconda Navigator every time you start Jupyter Notebook. Therefore, you can start it by following the steps below.
--Start the Windows command prompt with Windos button + cmd. --Run the Anaconda installation directory \ Scripts \ activate command to activate the virtual environment. Specify the created virtual environment name (example: tensorflow) in the argument. --The prompt will change to something like (tensorflow). --Cd to your working folder and run the jupyter notebook command.
To stop the Jupyter Notebook, press Ctrl + C in the Terminal window where you ran the jupyter notebook command to stop the process.
that's all.
Recommended Posts