-
Notifications
You must be signed in to change notification settings - Fork 2
/
env.sh
executable file
·81 lines (67 loc) · 2.14 KB
/
env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#! /bin/bash
################################################################################
# env.sh
#
# Set up an Anaconda virtualenv in the directory ./env
#
# Run this script from the root of the project, i.e.
# ./env.sh
#
# Requires that conda be installed and set up for calling from bash scripts.
#
# Also requires that you set the environment variable CONDA_HOME to the
# location of the root of your anaconda/miniconda distribution.
################################################################################
PYTHON_VERSION=3.6
############################
# HACK ALERT *** HACK ALERT
# The friendly folks at Anaconda thought it would be a good idea to make the
# "conda" command a shell function.
# See https://github.com/conda/conda/issues/7126
# The following workaround will probably be fragile.
if [ -z "$CONDA_HOME" ]
then
echo "Error: CONDA_HOME not set"
exit
fi
. ${CONDA_HOME}/etc/profile.d/conda.sh
# END HACK
############################
################################################################################
# Remove any previous outputs of this script
rm -rf ./env
rm -rf ./graph_def_editor
################################################################################
# Create the environment
conda create -y --prefix ./env \
python=${PYTHON_VERSION} \
numpy \
tensorflow==1.13.1 \
jupyterlab \
pytest \
keras \
pillow \
nomkl
conda activate ./env
# Install tensorflowjs
pip install --no-deps tensorflowjs==0.8.5
pip install tensorflow-hub==0.1.1
# Install the latest master branch of GDE
git clone https://github.com/CODAIT/graph_def_editor.git
# Temporary: Use my branch until my latest PR is merged
#git clone https://github.com/frreiss/graph_def_editor.git
#cd graph_def_editor
#git checkout issue-savedmodel
#cd ..
pip install ./graph_def_editor/
# Install additional dependencies required for WML
pip install ibm-cos-sdk
pip install watson-machine-learning-client
# conda install -c conda-forge awscli
conda deactivate
# Delay so that the message ends up at the end of script output
sleep 1
echo << EOM
Anaconda virtualenv installed in ./env.
Run \"conda activate ./env\" to use it.
EOM