Last update: 02/26/2019
https://github.com/tensorflow/haskell
- Stack (covered by this guide)
- latest TensorFlow Haskell git version
- TensorFlow C library 1.9.0
- stack resolver: lts-12.26
- GHC 8.4.4
- Nix
- latest TensorFlow Haskell git version
- TensorFlow C library 1.9.0
- stack resolver: lts-12.26
- GHC 8.4.4
- Docker
- GPU support
- TensorFlow Haskell version 0.2.0.0
- TensorFlow C library 1.9.0
- stack resolver: lts-11.9
- GHC 8.2.2
To automatically setup the environment, check CentOS 7.6 Environment Setup Script. Manual steps are as follows:
curl -sSL https://get.haskellstack.org/ | sh
The rpm version on CentOS 7.6 is too old (2.5.0-8.el7 released in 2015). All
Fedora rpms cannot be installed on CentOS due to broken dependencies. To
compile the latest version of protobuf
from git:
sudo yum install autoconf automake libtool unzip gcc-c++ git -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure --prefix=/usr
make
sudo make install
snappy
is usually installed. To ensure the installation:
sudo yum install snappy -y
wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.9.0.tar.gz
tar zxf libtensorflow-cpu-linux-x86_64-1.9.0.tar.gz
sudo cp -r lib/* /usr/lib64/
sudo cp -r include/* /usr/include/
sudo ldconfig
- Create your Haskell project
stack new my-project
cd my-project
- Edit the
stack.yaml
file
resolver: lts-12.26
extra-deps:
- git: https://github.com/tensorflow/haskell.git
commit: c7426a3f00d959ccff8bd631e34ba4c805f7e654
subdirs:
- tensorflow
- tensorflow-ops
- tensorflow-core-ops
- tensorflow-logging
- tensorflow-proto
- tensorflow-opgen
- tensorflow-test
- tensorflow-mnist
- tensorflow-mnist-input-data
- Compile
stack setup
stack build
- Run your project
stack exec my-project-exe