Keras installation in Anaconda (Windows and Mac )
Before installing keras library, make sure you watch previous video of how to create and activate anaconda environment. Follow below steps to install keras:
- Open terminal and activate conda environment using below command
- For Windows : activate deeplearning
- For MacOS : source activate deeplearning
- Once conda environment activated, use below command
- conda install keras
- Proceed installation by pressing “y”.
- Once it gets installed. Open python terminal using keyword “python”
- Import keras library.
- If you dont get any errors, that means your keras library has been successfully installed.
- If you get an error, try installing library again
- As keras is using tensorflow backend by default, to change keras backend theano instead follow below procedure:
- If you are in windows: go to your userprofile directory > .keras > keras.json
- If you are in Mac: go to home directory > .keras > keras.json
- Open keras.json file and change the backend “tensorflow” to “theano”
- If theano library is not installed, write below command in your deeplearning environment,
- conda install theano
- Once theano gets successfully installed, validate installation by importing theano in python consol
- After validating theano installation, open python terminal again and import keras, this time keras will use theano backend instead tensorflow.
0 Comments:
Post a Comment