LoginSignup
3
0

More than 5 years have passed since last update.

Rlang での tensorflow 環境の作り方

Posted at

動機

Tokyo.R で R から TensorFlow を使っててかっこよかった

環境

macOS 10.12.6

brew をインストールする

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

miniconda をインストールする

$ brew install miniconda

PATH を通す

~/.zshrc などに記述

export PATH="/usr/local/miniconda3/bin:$PATH"

有効にする

source ~/.zshrc

確認する

$ python3

virtualenv で仮想環境を作る

$ conda create --name r-tensorflow python=3.6

確認する

$ conda info -e

仮想環境をアクティベートする

$ source activate r-tensorflow

tensorflow を入れる

pip3 install --ignore-installed --upgrade tensorflow

keras も入れる

conda install -c conda-forge keras

R での操作

install.packages("curl")
install.packages("keras")
library(keras)
install_keras()

MNIST など

keras.rstudio

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0