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

  • R Deep Learning Cookbook
  • Dr. PKS Prakash Achyutuni Sri Krishna Rao
  • 132字
  • 2021-07-02 20:49:06

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
主站蜘蛛池模板: 伊春市| 泰宁县| 长岛县| 榆社县| 竹北市| 游戏| 巴塘县| 信宜市| 荆门市| 全椒县| 东港市| 斗六市| 六枝特区| 石屏县| 海伦市| 永善县| 梁平县| 突泉县| 潢川县| 广河县| 清河县| 石门县| 刚察县| 呼伦贝尔市| 拉萨市| 礼泉县| 霸州市| 太仓市| 临沂市| 大姚县| 陇南市| 宣城市| 当阳市| 南雄市| 榆中县| 且末县| 大姚县| 玉林市| 濮阳县| 霞浦县| 九江县|