WIN10 System Installation Anaconda+tensorflow+keras

Source: Internet
Author: User
Tags keras

Small white One, the installation process went a lot of pits, and then installed for several days, so record a bit.

First, install the Anaconda

Official: https://repo.continuum.io/archive/

option to install the appropriate version, I installed the anaconda3-4.4.0-windows-x86_64.exe version, with the Python version 3.6.

Installation:

Installation path I direct default C drive, the installation process all the way next.

In the installation options step, I did not select Add Anaconda to my PATH environment variable as stated on the official website.

Official Installation Tutorial: Https://docs.anaconda.com/anaconda/install/windows

After the installation is complete, configure the PATH variable.

Right--My computer, properties, advanced options, environment variable--system variable--add a path to the->path->: There are three additions, respectively:

~\anaconda3

~\anaconda3\scripts

~\anaconda3\library\bin

Take the environment variables I configured as an example:

At this point, the Anaconda installation is complete.

CMD, enter Python, display the Python version, indicating that the installation was successful.

Second, installation TensorFlow

Open Anaconda Prompt

1. Upgrade Pip to the latest version:

2. Create an environment named TensorFlow and install the Python3.5.2

Conda Create--name TensorFlow python=3.5.2

Enter Y, enter. After the installation is complete:

3. Activate this environment: Activate TensorFlow

4. Installing TensorFlow

Pip Install TensorFlow

Note: To install TensorFlow in an environment that has just been created with the name TensorFlow. That is, the command line is preceded by (TensorFlow)

Verify that the installation is successful:

Enter Python, and then enter import TensorFlow as TF, if the next line appears <<<, then TensorFlow installation is successful,

Third, installation Keras

Re-enter Anaconda Prompt

1. Installing Keras

Pip Install Keras

2. Installing MinGW

Conda Install MinGW Libpython

Note: Both Keras and MinGW are installed in the TensorFlow environment.

The Keras installation is successful at this time.

Verification: Enter Python, enter import Keras, display the using TensorFlow backed, the installation is successful.

Iv. examples

Open the Spyder in Anaconda Navigator,

Copy the example under Keras official website, http://keras-cn.readthedocs.io/en/latest/getting_started/sequential_model/

ImportNumPy as NP fromKeras.modelsImportSequential fromKeras.layersImportDense, dropout#Generate Dummy DataX_train = Np.random.random ((1000, 20)) Y_train= Np.random.randint (2, size= (1000, 1)) X_test= Np.random.random ((100, 20)) Y_test= Np.random.randint (2, size= (100, 1)) Model=sequential () model.add (Dense (Input_dim=20, activation='Relu')) Model.add (Dropout (0.5)) Model.add (Dense (Activation=,'Relu')) Model.add (Dropout (0.5)) Model.add (Dense (1, activation='sigmoid')) Model.compile (loss='binary_crossentropy', Optimizer='Rmsprop', Metrics=['accuracy']) Model.fit (X_train, Y_train, epochs=20, Batch_size=128) score= Model.evaluate (X_test, Y_test, batch_size=128)

The result of the operation is as follows

------------------------------------------------------------------------------------------Split Line---------------------------- --------------------------------------------------------------------

Part of the error encountered during installation:

1. After installing Keras, when importing Keras, error importerror:no module named ' Keras ',

Workaround: Install Keras in the TensorFlow environment that you just installed. Instead of opening Anaconda prompt to install directly,

Error Installation:

Correct installation:

2. Cannot open Anaconda navigator:could not find or load the QT platform plugin "windows in",

Workaround: Copy the Platforms folder under the \anaconda3\library\plugins directory to \anaconda3 and reopen Anaconda Navigator

Resources:

http://blog.csdn.net/u013829973/article/details/70555037

https://www.jianshu.com/p/f50bbfcb3674

http://blog.csdn.net/isomebody/article/details/72910207

WIN10 System Installation Anaconda+tensorflow+keras

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.