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

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
主站蜘蛛池模板: 宝应县| 九龙城区| 秦皇岛市| 龙井市| 万全县| 永兴县| 元氏县| 株洲县| 德令哈市| 宜宾县| 阿拉善左旗| 容城县| 海口市| 南通市| 中山市| 玉溪市| 辽阳市| 乐至县| 九江县| 靖远县| 星子县| 南安市| 唐河县| 临沧市| 紫阳县| 昌平区| 启东市| 大城县| 道真| 淳化县| 托克托县| 从化市| 永新县| 南平市| 莱阳市| 额尔古纳市| 平阳县| 景谷| 萨嘎县| 秭归县| 卢湾区|