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

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
主站蜘蛛池模板: 滨州市| 汉沽区| 门源| 德阳市| 双鸭山市| 青浦区| 江油市| 澄江县| 汉寿县| 勐海县| 屯留县| 阿鲁科尔沁旗| 胶州市| 西藏| 辽宁省| 镇康县| 德清县| 沿河| 恩施市| 长岛县| 且末县| 邯郸市| 黄冈市| 齐齐哈尔市| 舞钢市| 田林县| 光泽县| 柘荣县| 建德市| 吴江市| 电白县| 长汀县| 赤水市| 营口市| 和田市| 喜德县| 新安县| 隆子县| 乌兰浩特市| 五指山市| 彰化市|