-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
95 lines (93 loc) · 5.83 KB
/
INSTALL.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
DDSL on Windows:
Build zlib in .\contrib\zlib-1.2.8
mkdir build
cd build
cmake -G "Visual Studio 14 Win64" ..
Open Visual Studio Solution and compile as Release and Debug
Go to the release folder and copy the zlib.lib and the zconf.h to the .\contrib\zlib-1.2.8
Build lpng in .\contrib\lpng1628
mkdir build
cd build
cmake -G "Visual Studio 14 Win64" -DZLIB_ROOT="C:\Projects\DSL\contrib\zlib-1.2.8" ..
Open Visual Studio Solution and compile as Release and Debug
** libpng wil crash if there is a mismatch between (\MD and \MdD, etc.)
Download and install ArrayFire in its default location
Build Caffe
Checkout Caffe Windows branch in /contrib/caffe (git clone -b windows https://github.com/BVLC/caffe.git)
Patch for official Caffe branch because (https://github.com/BVLC/caffe/issues/2578)
In /contrib/caffe/src/caffe/layer_factory.cpp
Add "if (registry.count(type) > 0) return;" in a line before "CHECK_EQ(registry.count(type), 0) << "Layer type " << type << " already registered.";"
In /contrib/caffe/src/caffe/solver_factory.cpp
Add "if (registry.count(type) > 0) return;" in a line before "CHECK_EQ(registry.count(type), 0) << "Solver type " << type << " already registered.";"
Build Caffe with instructions: https://github.com/BVLC/caffe/tree/windows
Install Miniconda and create an python 3.5 environment with all dependencies.
conda create -n py35 python=3.5 anaconda
activate py35
** make sure that you are located in the caffe folder and that you are not located in the scripts folder
In scripts\build_win.cmd change all occurences of "if NOT DEFINED WITH_NINJA set WITH_NINJA=1" to "if NOT DEFINED WITH_NINJA set WITH_NINJA=0"
In scripts\build_win.cmd change all occurences of "if NOT DEFINED CPU_ONLY set CPU_ONLY=1" to "if NOT DEFINED CPU_ONLY set CPU_ONLY=0"
In scripts\build_win.cmd change all occurences of "if NOT DEFINED PYTHON_VERSION set PYTON_VERSION=2" to "if NOT DEFINED PYTHON_VERSION set PYTON_VERSION=3"
if you want to use the GPU (make sure you have got a NVIDIA GPU that has a compute capabillity >= 6.0)
Execute: scripts\build_win.cmd
If something fails remove build\CMakeCache.txt
You can also build debug Caffe by opening the solution and compiling with the Debug profile.
Patch cmake errors
In /contrib/caffe/build/CaffeTargets.cmake rename gflags_shared, hdf5_shared, hdf5_hl_shared to gflags, caffehdf5, caffehdf5_hl
In /contrib/caffe/build/CaffeTargets.cmake rename the first occurence of leveldb to leveldbd, that is the variable IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG version.
In c:/users/<username>/.caffe/.caffe\dependencies\libraries_v140_x64_py35_1.1.0\libraries\lib rename libopenblas-dll.a, libopenblas.a to libopenblas-dll.a.lib, libopenblas.a.lib
Download OpenCV binaries to %ProgramFiles%\opencv
Add (or equivalent) %ProgramFiles%\opencv\build\x64\vc14\bin to your path
Build DDSL in .\
mkdir build
cd build
cmake -G "Visual Studio 14 Win64" ..
Open Visual Studio Solution and go add some stuff to ddsl_tester.exe and your good to go.
Copy all .dll files from:
.\contrib\caffe\build\libraries\bin
.\contrib\caffe\build\libraries\lib
.\contrib\caffe\build\libraries\x64\vc14\bin
.\contrib\zlib-1.2.8\build\Release
.\contrib\zlib-1.2.8\build\Debug
.\contrib\lpng1628\build\Release
.\contrib\lpng1628\build\Debug
to .\DLL\ and put this folder in your system path.
** If there is an error with executing the program make sure that you also put the python27.dll from C:\Users\...user-name...\Miniconda3\envs\py27
in the .\DLL folder. If you use py35 then you should follow the same path only to the py35 folder instead of the py27.
DDSL on Ubuntu
Install lpng
sudo apt-get libpng-dev
Download and install ArrayFirefrom their website
sudo apt-get install libglfw3-dev libnnvm-dev
Build Caffe
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopencv-dev libatlas-dev libatlas-base-dev libsnappy-dev
sudo apt-get install libhdf5-dev libhdf5-serial-dev libleveldb-dev liblmdb-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev protobuf-compiler libprotobuf-dev
sudo apt-get install libpython-dev
Install Cuda from http://docs.nvidia.com/cuda/index.html#axzz4YZYC9wB0 and https://developer.nvidia.com/cuda-downloads
Install NCCL
git clone https://github.com/NVIDIA/nccl.git
cd nccl
make CUDA_HOME=/usr/local/cuda test
sudo make PREFIX=/usr/local install
Install Caffe and DIGITS from GIT repo
After pip install -r requirements.txt do pip install -U scikit-image and then pip install -r requirements.txt again
Use multi-gpu with cmake -DUSE_NCCL=1 ..
Patch for official Caffe branch because (https://github.com/BVLC/caffe/issues/2578)
In /contrib/caffe/include/caffe/layer_factory.hpp
Add "if (registry.count(type) > 0) return;" in a line before "CHECK_EQ(registry.count(type), 0) << "Layer type " << type << " already registered.";"
In /contrib/caffe/include/caffe/solver_factory.hpp
Add "if (registry.count(type) > 0) return;" in a line before "CHECK_EQ(registry.count(type), 0) << "Solver type " << type << " already registered.";"
Build DDSL in .\
mkdir build
cd build
cmake ..
make
Go add some stuff to ddsl_tester and your good to go.
DIGITS in Windows (quite the hassle)
Follow: https://github.com/NVIDIA/DIGITS/blob/digits-4.0/docs/BuildDigitsWindows.md
Enable the Python stuff in the DDSL\3rdparty\Caffe folder
Before doing: "python -m pip install -r requirements.txt" change the "requirements.txt" file and increment the maximum version to the one downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/
Somehow one of the steps breaks packages installed by http://www.lfd.uci.edu/~gohlke/pythonlibs/
Fix this by just re-executing the python -m pip install lines before starting DIGITS
Manually download and install Pillow from http://www.lfd.uci.edu/~gohlke/pythonlibs/