Keras: Difference between revisions
Jump to navigation
Jump to search
(Marked this version for translation) |
(rm links to unwritten pages) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<languages /> | <languages /> | ||
[[Category:Software]] | [[Category:Software]][[Category:AI and Machine Learning]] | ||
<translate> | <translate> | ||
<!--T:1--> | <!--T:1--> | ||
Line 6: | Line 6: | ||
<!--T:9--> | <!--T:9--> | ||
If you are porting a Keras program to | If you are porting a Keras program to one of our clusters, you should follow [[Tutoriel Apprentissage machine/en|our tutorial on the subject]]. | ||
==Installing== <!--T:2--> | ==Installing== <!--T:2--> | ||
<!--T:3--> | <!--T:3--> | ||
#Install | #Install [[TensorFlow]], CNTK, or Theano in a Python [[Python#Creating_and_using_a_virtual_environment|virtual environment]]. | ||
#Activate the Python virtual environment (named <tt>$HOME/tensorflow</tt> in our example). | #Activate the Python virtual environment (named <tt>$HOME/tensorflow</tt> in our example). | ||
#:{{Command2|source $HOME/tensorflow/bin/activate}} | #:{{Command2|source $HOME/tensorflow/bin/activate}} | ||
Line 25: | Line 25: | ||
<!--T:6--> | <!--T:6--> | ||
#Install TensorFlow for R by following | #Install TensorFlow for R by following [[Tensorflow#R_package | these instructions]]. | ||
#Follow the instructions from the parent section. | #Follow the instructions from the parent section. | ||
#Load the required modules. | #Load the required modules. |
Latest revision as of 16:11, 27 June 2023
"Keras is a high-level neural networks API, written in Python and capable of running on top of TensorFlow, CNTK, or Theano."[1]
If you are porting a Keras program to one of our clusters, you should follow our tutorial on the subject.
Installing
- Install TensorFlow, CNTK, or Theano in a Python virtual environment.
- Activate the Python virtual environment (named $HOME/tensorflow in our example).
[name@server ~]$ source $HOME/tensorflow/bin/activate
- Install Keras in your virtual environment.
(tensorflow)_[name@server ~]$ pip install keras
R package
This section details how to install Keras for R and use TensorFlow as the backend.
- Install TensorFlow for R by following these instructions.
- Follow the instructions from the parent section.
- Load the required modules.
[name@server ~]$ module load gcc/7.3.0 r/3.5.2
- Launch R.
[name@server ~]$ R
- In R, install the Keras package with
devtools
.devtools::install_github('rstudio/keras')
You are then good to go. Do not call install_keras()
in R, as Keras and TensorFlow have already been installed in your virtual environment with pip
. To use the Keras package installed in your virtual environment, enter the following commands in R after the environment has been activated.
library(keras)
use_virtualenv(Sys.getenv('VIRTUAL_ENV'))