레이블이 except Exception인 게시물을 표시합니다. 모든 게시물 표시
레이블이 except Exception인 게시물을 표시합니다. 모든 게시물 표시

2018년 5월 11일 금요일

ppc64le 환경에서 NVIDIA DIGITS의 설치

먼저 알아두셔야 하는 것이, NVIDIA DIGITS를 사용하기 위해서는 caffe 설치는 필수이며 또 python2만 지원된다는 것입니다.   python3는 현재 지원되지 않습니다. 

[ibm@centos01 ~]$ sudo yum install graphviz graphviz-devel gfortran libxkbcommon-x11-devel xorg-x11-server-devel

[ibm@centos01 ~]$ which pip
~/anaconda2/bin/pip

먼저 caffe를 설치한 뒤, 다음과 같이 caffe가 요구하는 python package들을 설치합니다.

[ibm@centos01 DIGITS]$ env | grep ROOT
DIGITS_ROOT=/home/ibm/DIGITS
CAFFE_ROOT=/home/ibm/caffe

[ibm@centos01 ~]$ pip install -r $CAFFE_ROOT/python/requirements.txt

특히 caffe 설치 때 make pycaffe를 수행하는 것을 잊지 마셔야 합니다.

[ibm@centos01 caffe]$ pwd
/home/ibm/caffe

[ibm@centos01 caffe]$ make pycaffe

이제 DIGITS source code를 download 받습니다.

[ibm@centos01 ~]$ git clone https://github.com/NVIDIA/DIGITS.git

[ibm@centos01 ~]$ cd DIGITS

[ibm@centos01 DIGITS]$ vi requirements.txt
...
#h5py>=2.2.1,<=2.6.0
h5py>=2.2.1,<=2.7.1
#pydot>=1.0.28,<=1.0.29
pydot>=1.2.4,<1.2.5
...

위와 같이 수정하지 않으면 다음과 같이 h5py 및 pydot에서 다음과 같은 error들을 겪게 됩니다.

    /tmp/pip-build-csqz23it/h5py/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
     #include "hdf5.h"
                      ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

      File "/tmp/pip-build-5i5hsyt1/pydot/pydot.py", line 31
        except Exception, e:
                        ^
    SyntaxError: invalid syntax
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5i5hsyt1/pydot/

기본적으로 DIGITS는 python2로 작성된 script라 pip로 필요 package들을 다음과 같이 설치하면 됩니다.

[ibm@centos01 DIGITS]$ pip install -r ./requirements.txt

추가로 다음과 같은 python package를 수동으로 설치해야 합니다. 

[ibm@centos01 DIGITS]$ pip install scikit-fmm

그러지 않으면 다음과 같은 에러가 날 수 있습니다.

ImportError: No module named skfmm

이제 digits 서버를 구동합니다.  digits 서버는 daemon화 되어 있지 않으므로, nohup으로 돌리시는 것이 좋습니다. 

[ibm@centos01 DIGITS]$ ./digits-devserver &
  ___ ___ ___ ___ _____ ___
 |   \_ _/ __|_ _|_   _/ __|
 | |) | | (_ || |  | | \__ \
 |___/___\___|___| |_| |___/ 6.1.1

/home/ibm/anaconda2/lib/python2.7/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
cudaRuntimeGetVersion() failed with error #30
2018-05-11 16:09:54 [INFO ] Loaded 0 jobs.

위에서 난 cudaRuntimeGetVersion() error는 이 서버에는 GPU가 없기 때문에 발생한 것이니 무시하셔도 됩니다.

이제 5000번 port로 연결해보면 다음과 같이 메뉴가 나옵니다.  다음번에는 DIGITS를 이용하여 data preprocessing부터 해보도록 하겠습니다.