This repository has been archived by the owner on Jul 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.txt
65 lines (52 loc) · 2.71 KB
/
setup.txt
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
Install Anaconda (Python 3.6 version)
https://www.anaconda.com/download/#linux
Install CUDA:
http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
Install keras and tensorflow-gpu backend (GPU backend for efficient training):
conda update --all
conda install tensorflow-gpu keras
If you ONLY want to do inference (i.e. make predictions) the CPU backend is sufficient:
conda install tensorflow keras
Edit ~./keras/keras.json to specify preferred backend.
Models were created and trained with the theano backend but should work
fine with the tensorflow backend as well. Unfortunately, saving training
histories does not seem to work with the tensorflow backend anymore.
theano backend (development of theano is discontinued):
{
"epsilon": 1e-07,
"backend": "theano",
"floatx": "float32",
"image_dim_ordering": "th",
"image_data_format": "channels_first"
}
to use the tensorflow-gpu backend:
{
"floatx": "float32",
"backend": "tensorflow",
"image_dim_ordering": "th",
"image_data_format": "channels_first",
"epsilon": 1e-07
}
The image data format can also be set directly in Python if you don't want to change the tensorflow configuration files:
# somewhere after initial imports
import keras.backend as K
K.set_image_data_format("channels_first")
run nvidia-smi to check CUDA status:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 387.26 Driver Version: 387.26 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1070 Off | 00000000:09:00.0 On | N/A |
| 0% 45C P2 64W / 200W | 7883MiB / 8105MiB | 98% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1264 G /usr/lib/xorg/Xorg 110MiB |
| 0 4747 C /home/js/anaconda3/bin/python 7685MiB |
+-----------------------------------------------------------------------------+
Open the Jupyter notebook:
jupyter notebook mnist.ipynb