官术网_书友最值得收藏!

How to do it...

  1. Once all the mentioned dependencies are installed, tensorflow can be installed from devtools directly using the install_github command as follows:
devtools::install_github("rstudio/tensorflow")
  1. Before loading tensorflow in R, you need to set up the path for Python as the system environment variable. This can be done directly from the R environment, as shown in the following command:
Sys.setenv(TENSORFLOW_PYTHON="/usr/bin/python")
library(tensorflow)

If the Python tensorflow module is not installed, R will give the following error:

Error raised by R if tensorflow in Python is not installed

tensorflow in Python can be installed using pip:

pip install tensorflow # Python 2.7 with no GPU support
pip3 install tensorflow # Python 3.x with no GPU support
pip install tensorflow-gpu # Python 2.7 with GPU support
pip3 install tensorflow-gpu # Python 3.x with GPU support
主站蜘蛛池模板: 通化市| 确山县| 类乌齐县| 乐业县| 洛川县| 嘉善县| 弥渡县| 丰原市| 峨边| 青岛市| 云安县| 墨玉县| 永靖县| 南宫市| 兴义市| 工布江达县| 宜兰市| 西宁市| 临高县| 利辛县| 泌阳县| 靖宇县| 湾仔区| 西吉县| 上林县| 本溪市| 台北市| 忻城县| 江华| 白银市| 淮滨县| 修文县| 新沂市| 左权县| 柞水县| 大冶市| 青海省| 梧州市| 潜山县| 林口县| 华容县|