CentOSへの移行(その2)
CentOS7.6上にAnacondaでTensorFlow をインストール

March 3, 2019 – 2:13 pm

前回(CentOSへの移行(その1))で、最小限機能のCentOSサーバを作成したが、このうえに最近話題の「機械学習モデル」の構築のためのライブラリ TensorFlowをインストールした。

以前から、このライブラリには興味があった。CentOSへの移行作業という意味では、かなりの寄り道になるが、個人的興味を優先した次第。

Anacondaインストール

  1. インストール環境の整備

    • Home Directory /home/tensflow の確保・作成

      [root@localhost ~]# useradd tsflow
      [root@localhost ~]# passwd tsflow
      Changing password for user tsflow.
      New password: 
      Retype new password: 
      passwd:
      all authentication tokens updated successfully.
      
    • bzip2をyum インストール

      [root@localhost ~]# yum install bzip2
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
       * base: ftp.tsukuba.wide.ad.jp
       * extras: ftp.sjtu.edu.cn
       * updates: ftp.sjtu.edu.cn
      Resolving Dependencies
      -->; Running transaction check
      --->; Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
      -->; Finished Dependency Resolution
      
      Dependencies Resolved
      
      ===========================================================================================================================
       Package                    Arch                        Version                            Repository                 Size
      ===========================================================================================================================
      Installing:
       bzip2                      x86_64                      1.0.6-13.el7                       base                       52 k
      
      Transaction Summary
      ===========================================================================================================================
      Install  1 Package
      
      Total download size: 52 k
      Installed size: 82 k
      Is this ok [y/d/N]: y
      Downloading packages:
      bzip2-1.0.6-13.el7.x86_64.rpm                                                                       |  52 kB  00:00:00     
      Running transaction check
      Running transaction test
      Transaction test succeeded
      Running transaction
        Installing : bzip2-1.0.6-13.el7.x86_64                                                                               1/1 
        Verifying  : bzip2-1.0.6-13.el7.x86_64                                                                               1/1 
      
      Installed:
        bzip2.x86_64 0:1.0.6-13.el7                                                                                              
      
      Complete!
      

     

  2. Anaconda 2018.12 for Linux Installer のダウンロード
     Download Site: Anaconda Distributhion
     Downloaded : 64-Bit (x86) Installer (652.5 MB)
      
  3. Installerの実行
    [tsflow@localhost ~]$ bash Anaconda3-2018.12-Linux-x86_64.sh
    
    Welcome to Anaconda3 2018.12
    
    In order to continue the installation process, please review the license
    agreement.
    Please, press ENTER to continue
    >;>;>; 
    ===================================
    Anaconda End User License Agreement
    ===================================
      (省 略)
    Do you accept the license terms? [yes|no]
    [no] >;>;>; yes
    
    Anaconda3 will now be installed into this location:
    /home/tsflow/anaconda3
    
      - Press ENTER to confirm the location
      - Press CTRL-C to abort the installation
      - Or specify a different location below
    [/home/tsflow/anaconda3] >;>;>; 
    PREFIX=/home/tsflow/anaconda3
    installing: python-3.7.1-h0371630_7 ...
    Python 3.7.1
    installing: blas-1.0-mkl ...
    installing: ca-certificates-2018.03.07-0 ...
    installing: conda-env-2.6.0-1 ...
    installing: intel-openmp-2019.1-144 ...
    installing: libgcc-ng-8.2.0-hdf63c60_1 ...
    installing: libgfortran-ng-7.3.0-hdf63c60_0 ...
    installing: libstdcxx-ng-8.2.0-hdf63c60_1 ...
    installing: bzip2-1.0.6-h14c3975_5 ...
    installing: expat-2.2.6-he6710b0_0 ...
    installing: fribidi-1.0.5-h7b6447c_0 ...
    installing: gmp-6.1.2-h6c8ec71_1 ...
    installing: graphite2-1.3.12-h23475e2_2 ...
    installing: icu-58.2-h9c2bf20_1 ...
    installing: jbig-2.1-hdba287a_0 ...
    installing: jpeg-9b-h024ee3a_2 ...
    installing: libffi-3.2.1-hd88cf55_4 ...
    installing: liblief-0.9.0-h7725739_1 ...
    installing: libsodium-1.0.16-h1bed415_0 ...
    installing: libtool-2.4.6-h7b6447c_5 ...
    installing: libuuid-1.0.3-h1bed415_2 ...
    installing: libxcb-1.13-h1bed415_1 ...
    installing: lz4-c-1.8.1.2-h14c3975_0 ...
    installing: lzo-2.10-h49e0be7_2 ...
    installing: mkl-2019.1-144 ...
    installing: ncurses-6.1-he6710b0_1 ...
    installing: openssl-1.1.1a-h7b6447c_0 ...
    installing: patchelf-0.9-he6710b0_3 ...
    installing: pcre-8.42-h439df22_0 ...
    installing: pixman-0.34.0-hceecf20_3 ...
    installing: snappy-1.1.7-hbae5bb6_3 ...
    installing: xz-5.2.4-h14c3975_4 ...
    installing: yaml-0.1.7-had09818_2 ...
    installing: zlib-1.2.11-h7b6447c_3 ...
    installing: blosc-1.14.4-hdbcaa40_0 ...
    installing: glib-2.56.2-hd408876_0 ...
    installing: hdf5-1.10.2-hba1933b_1 ...
    installing: libedit-3.1.20170329-h6b74fdf_2 ...
    installing: libpng-1.6.35-hbc83047_0 ...
    installing: libssh2-1.8.0-h1ba5d50_4 ...
    installing: libtiff-4.0.9-he85c1e1_2 ...
    installing: libxml2-2.9.8-h26e45fe_1 ...
    installing: mpfr-4.0.1-hdf1c602_3 ...
    installing: pandoc-1.19.2.1-hea2e7c5_1 ...
    installing: readline-7.0-h7b6447c_5 ...
    installing: tk-8.6.8-hbc83047_0 ...
    installing: zeromq-4.2.5-hf484d3e_1 ...
    installing: zstd-1.3.7-h0b5b093_0 ...
    installing: dbus-1.13.2-h714fa37_1 ...
    installing: freetype-2.9.1-h8a8886c_1 ...
    installing: gstreamer-1.14.0-hb453b48_1 ...
    installing: krb5-1.16.1-h173b8e3_7 ...
    installing: libarchive-3.3.3-h5d8350f_5 ...
    installing: libxslt-1.1.32-h1312cb7_0 ...
    installing: mpc-1.1.0-h10f8cd9_1 ...
    installing: sqlite-3.26.0-h7b6447c_0 ...
    installing: unixodbc-2.3.7-h14c3975_0 ...
    installing: fontconfig-2.13.0-h9420a91_0 ...
    installing: gst-plugins-base-1.14.0-hbbd80ab_1 ...
    installing: libcurl-7.63.0-h20c2e04_1000 ...
    installing: alabaster-0.7.12-py37_0 ...
    installing: asn1crypto-0.24.0-py37_0 ...
    installing: atomicwrites-1.2.1-py37_0 ...
    installing: attrs-18.2.0-py37h28b3542_0 ...
    installing: backcall-0.1.0-py37_0 ...
    installing: backports-1.0-py37_1 ...
    installing: beautifulsoup4-4.6.3-py37_0 ...
    installing: bitarray-0.8.3-py37h14c3975_0 ...
    installing: boto-2.49.0-py37_0 ...
    installing: cairo-1.14.12-h8948797_3 ...
    installing: certifi-2018.11.29-py37_0 ...
    installing: chardet-3.0.4-py37_1 ...
    installing: click-7.0-py37_0 ...
    installing: cloudpickle-0.6.1-py37_0 ...
    installing: colorama-0.4.1-py37_0 ...
    installing: contextlib2-0.5.5-py37_0 ...
    installing: curl-7.63.0-hbc83047_1000 ...
    installing: dask-core-1.0.0-py37_0 ...
    installing: decorator-4.3.0-py37_0 ...
    installing: defusedxml-0.5.0-py37_1 ...
    installing: docutils-0.14-py37_0 ...
    installing: entrypoints-0.2.3-py37_2 ...
    installing: et_xmlfile-1.0.1-py37_0 ...
    installing: fastcache-1.0.2-py37h14c3975_2 ...
    installing: filelock-3.0.10-py37_0 ...
    installing: future-0.17.1-py37_0 ...
    installing: glob2-0.6-py37_1 ...
    installing: gmpy2-2.0.8-py37h10f8cd9_2 ...
    installing: greenlet-0.4.15-py37h7b6447c_0 ...
    installing: heapdict-1.0.0-py37_2 ...
    installing: idna-2.8-py37_0 ...
    installing: imagesize-1.1.0-py37_0 ...
    installing: importlib_metadata-0.6-py37_0 ...
    installing: ipython_genutils-0.2.0-py37_0 ...
    installing: itsdangerous-1.1.0-py37_0 ...
    installing: jdcal-1.4-py37_0 ...
    installing: jeepney-0.4-py37_0 ...
    installing: kiwisolver-1.0.1-py37hf484d3e_0 ...
    installing: lazy-object-proxy-1.3.1-py37h14c3975_2 ...
    installing: llvmlite-0.26.0-py37hd408876_0 ...
    installing: locket-0.2.0-py37_1 ...
    installing: lxml-4.2.5-py37hefd8a0e_0 ...
    installing: markupsafe-1.1.0-py37h7b6447c_0 ...
    installing: mccabe-0.6.1-py37_1 ...
    installing: mistune-0.8.4-py37h7b6447c_0 ...
    installing: mkl-service-1.1.2-py37he904b0f_5 ...
    installing: mpmath-1.1.0-py37_0 ...
    installing: msgpack-python-0.5.6-py37h6bb024c_1 ...
    installing: numpy-base-1.15.4-py37hde5b4d6_0 ...
    installing: olefile-0.46-py37_0 ...
    installing: pandocfilters-1.4.2-py37_1 ...
    installing: parso-0.3.1-py37_0 ...
    installing: pep8-1.7.1-py37_0 ...
    installing: pickleshare-0.7.5-py37_0 ...
    installing: pkginfo-1.4.2-py37_1 ...
    installing: pluggy-0.8.0-py37_0 ...
    installing: ply-3.11-py37_0 ...
    installing: prometheus_client-0.5.0-py37_0 ...
    installing: psutil-5.4.8-py37h7b6447c_0 ...
    installing: ptyprocess-0.6.0-py37_0 ...
    installing: py-1.7.0-py37_0 ...
    installing: py-lief-0.9.0-py37h7725739_1 ...
    installing: pycodestyle-2.4.0-py37_0 ...
    installing: pycosat-0.6.3-py37h14c3975_0 ...
    installing: pycparser-2.19-py37_0 ...
    installing: pycrypto-2.6.1-py37h14c3975_9 ...
    installing: pycurl-7.43.0.2-py37h1ba5d50_0 ...
    installing: pyflakes-2.0.0-py37_0 ...
    installing: pyodbc-4.0.25-py37he6710b0_0 ...
    installing: pyparsing-2.3.0-py37_0 ...
    installing: pysocks-1.6.8-py37_0 ...
    installing: python-libarchive-c-2.8-py37_6 ...
    installing: pytz-2018.7-py37_0 ...
    installing: pyyaml-3.13-py37h14c3975_0 ...
    installing: pyzmq-17.1.2-py37h14c3975_0 ...
    installing: qt-5.9.7-h5867ecd_1 ...
    installing: qtpy-1.5.2-py37_0 ...
    installing: rope-0.11.0-py37_0 ...
    installing: ruamel_yaml-0.15.46-py37h14c3975_0 ...
    installing: send2trash-1.5.0-py37_0 ...
    installing: simplegeneric-0.8.1-py37_2 ...
    installing: sip-4.19.8-py37hf484d3e_0 ...
    installing: six-1.12.0-py37_0 ...
    installing: snowballstemmer-1.2.1-py37_0 ...
    installing: sortedcontainers-2.1.0-py37_0 ...
    installing: sphinxcontrib-1.0-py37_1 ...
    installing: sqlalchemy-1.2.15-py37h7b6447c_0 ...
    installing: tblib-1.3.2-py37_0 ...
    installing: testpath-0.4.2-py37_0 ...
    installing: toolz-0.9.0-py37_0 ...
    installing: tornado-5.1.1-py37h7b6447c_0 ...
    installing: tqdm-4.28.1-py37h28b3542_0 ...
    installing: unicodecsv-0.14.1-py37_0 ...
    installing: wcwidth-0.1.7-py37_0 ...
    installing: webencodings-0.5.1-py37_1 ...
    installing: werkzeug-0.14.1-py37_0 ...
    installing: wrapt-1.10.11-py37h14c3975_2 ...
    installing: wurlitzer-1.0.2-py37_0 ...
    installing: xlrd-1.2.0-py37_0 ...
    installing: xlsxwriter-1.1.2-py37_0 ...
    installing: xlwt-1.3.0-py37_0 ...
    installing: astroid-2.1.0-py37_0 ...
    installing: babel-2.6.0-py37_0 ...
    installing: backports.os-0.1.1-py37_0 ...
    installing: backports.shutil_get_terminal_size-1.0.0-py37_2 ...
    installing: cffi-1.11.5-py37he75722e_1 ...
    installing: cycler-0.10.0-py37_0 ...
    installing: cytoolz-0.9.0.1-py37h14c3975_1 ...
    installing: harfbuzz-1.8.8-hffaf4a1_0 ...
    installing: html5lib-1.0.1-py37_0 ...
    installing: jedi-0.13.2-py37_0 ...
    installing: mkl_fft-1.0.6-py37hd81dba3_0 ...
    installing: mkl_random-1.0.2-py37hd81dba3_0 ...
    installing: more-itertools-4.3.0-py37_0 ...
    installing: multipledispatch-0.6.0-py37_0 ...
    installing: nltk-3.4-py37_1 ...
    installing: openpyxl-2.5.12-py37_0 ...
    installing: packaging-18.0-py37_0 ...
    installing: partd-0.3.9-py37_0 ...
    installing: pathlib2-2.3.3-py37_0 ...
    installing: pexpect-4.6.0-py37_0 ...
    installing: pillow-5.3.0-py37h34e0f95_0 ...
    installing: pyqt-5.9.2-py37h05f1152_2 ...
    installing: python-dateutil-2.7.5-py37_0 ...
    installing: qtawesome-0.5.3-py37_0 ...
    installing: setuptools-40.6.3-py37_0 ...
    installing: singledispatch-3.4.0.3-py37_0 ...
    installing: sortedcollections-1.0.1-py37_0 ...
    installing: sphinxcontrib-websupport-1.1.0-py37_1 ...
    installing: sympy-1.3-py37_0 ...
    installing: terminado-0.8.1-py37_1 ...
    installing: traitlets-4.3.2-py37_0 ...
    installing: zict-0.1.3-py37_0 ...
    installing: bleach-3.0.2-py37_0 ...
    installing: clyent-1.2.2-py37_1 ...
    installing: cryptography-2.4.2-py37h1ba5d50_0 ...
    installing: cython-0.29.2-py37he6710b0_0 ...
    installing: distributed-1.25.1-py37_0 ...
    installing: get_terminal_size-1.0.0-haa9412d_0 ...
    installing: gevent-1.3.7-py37h7b6447c_1 ...
    installing: isort-4.3.4-py37_0 ...
    installing: jinja2-2.10-py37_0 ...
    installing: jsonschema-2.6.0-py37_0 ...
    installing: jupyter_core-4.4.0-py37_0 ...
    installing: navigator-updater-0.2.1-py37_0 ...
    installing: networkx-2.2-py37_1 ...
    installing: nose-1.3.7-py37_2 ...
    installing: numpy-1.15.4-py37h7e9f1db_0 ...
    installing: pango-1.42.4-h049681c_0 ...
    installing: path.py-11.5.0-py37_0 ...
    installing: pygments-2.3.1-py37_0 ...
    installing: pytest-4.0.2-py37_0 ...
    installing: wheel-0.32.3-py37_0 ...
    installing: bokeh-1.0.2-py37_0 ...
    installing: bottleneck-1.2.1-py37h035aef0_1 ...
    installing: conda-verify-3.1.1-py37_0 ...
    installing: datashape-0.5.4-py37_1 ...
    installing: flask-1.0.2-py37_1 ...
    installing: h5py-2.8.0-py37h989c5e5_3 ...
    installing: imageio-2.4.1-py37_0 ...
    installing: jupyter_client-5.2.4-py37_0 ...
    installing: matplotlib-3.0.2-py37h5429711_0 ...
    installing: nbformat-4.4.0-py37_0 ...
    installing: numba-0.41.0-py37h962f231_0 ...
    installing: numexpr-2.6.8-py37h9e4a6bb_0 ...
    installing: pandas-0.23.4-py37h04863e7_0 ...
    installing: pip-18.1-py37_0 ...
    installing: prompt_toolkit-2.0.7-py37_0 ...
    installing: pylint-2.2.2-py37_0 ...
    installing: pyopenssl-18.0.0-py37_0 ...
    installing: pytest-arraydiff-0.3-py37h39e3cac_0 ...
    installing: pytest-doctestplus-0.2.0-py37_0 ...
    installing: pytest-openfiles-0.3.1-py37_0 ...
    installing: pytest-remotedata-0.3.1-py37_0 ...
    installing: pywavelets-1.0.1-py37hdd07704_0 ...
    installing: scipy-1.1.0-py37h7c811a0_2 ...
    installing: secretstorage-3.1.0-py37_0 ...
    installing: bkcharts-0.2-py37_0 ...
    installing: dask-1.0.0-py37_0 ...
    installing: flask-cors-3.0.7-py37_0 ...
    installing: ipython-7.2.0-py37h39e3cac_0 ...
    installing: keyring-17.0.0-py37_0 ...
    installing: nbconvert-5.4.0-py37_1 ...
    installing: patsy-0.5.1-py37_0 ...
    installing: pytables-3.4.4-py37ha205bf6_0 ...
    installing: pytest-astropy-0.5.0-py37_0 ...
    installing: scikit-image-0.14.1-py37he6710b0_0 ...
    installing: scikit-learn-0.20.1-py37hd81dba3_0 ...
    installing: urllib3-1.24.1-py37_0 ...
    installing: astropy-3.1-py37h7b6447c_0 ...
    installing: ipykernel-5.1.0-py37h39e3cac_0 ...
    installing: odo-0.5.1-py37_0 ...
    installing: requests-2.21.0-py37_0 ...
    installing: statsmodels-0.9.0-py37h035aef0_0 ...
    installing: anaconda-client-1.7.2-py37_0 ...
    installing: blaze-0.11.3-py37_0 ...
    installing: jupyter_console-6.0.0-py37_0 ...
    installing: notebook-5.7.4-py37_0 ...
    installing: qtconsole-4.4.3-py37_0 ...
    installing: seaborn-0.9.0-py37_0 ...
    installing: sphinx-1.8.2-py37_0 ...
    installing: spyder-kernels-0.3.0-py37_0 ...
    installing: anaconda-navigator-1.9.6-py37_0 ...
    installing: anaconda-project-0.8.2-py37_0 ...
    installing: jupyterlab_server-0.2.0-py37_0 ...
    installing: numpydoc-0.8.0-py37_0 ...
    installing: widgetsnbextension-3.4.2-py37_0 ...
    installing: ipywidgets-7.4.2-py37_0 ...
    installing: jupyterlab-0.35.3-py37_0 ...
    installing: spyder-3.3.2-py37_0 ...
    installing: _ipyw_jlab_nb_ext_conf-0.1.0-py37_0 ...
    installing: jupyter-1.0.0-py37_7 ...
    installing: anaconda-2018.12-py37_0 ...
    installing: conda-4.5.12-py37_0 ...
    installing: conda-build-3.17.6-py37_0 ...
    installation finished.
    Do you wish the installer to initialize Anaconda3
    in your /home/tsflow/.bashrc ? [yes|no]
    [no] >;>;>; yes
    
    Initializing Anaconda3 in /home/tsflow/.bashrc
    A backup will be made to: /home/tsflow/.bashrc-anaconda3.bak
    
    
    For this change to become active, you have to open a new terminal.
    
    Thank you for installing Anaconda3!
    
    [tsflow@localhost ~]$ source .bashrc
    [tsflow@localhost ~]$
    [tsflow@localhost ~]$ conda -V
    conda 4.5.12
    

      

TensorFlow インストールと動作確認

  1. TensorFlow 仮想環境の作成
    [tsflow@localhost ~]$ 
    [tsflow@localhost ~]$ conda create -n tensorflow_env tensorflow
    Solving environment: done
    
    
    ==>; WARNING: A newer version of conda exists. <==
      current version: 4.5.12
      latest version: 4.6.7
    
    Please update conda by running
    
        $ conda update -n base -c defaults conda
    
    
    
    ## Package Plan ##
    
      environment location: /home/tsflow/anaconda3/envs/tensorflow_env
    
      added / updated specs: 
        - tensorflow
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        werkzeug-0.14.1            |           py36_0         423 KB
        setuptools-40.8.0          |           py36_0         647 KB
        wheel-0.33.1               |           py36_0          39 KB
        six-1.12.0                 |           py36_0          22 KB
        termcolor-1.1.0            |           py36_1           7 KB
        astor-0.7.1                |           py36_0          43 KB
        certifi-2018.11.29         |           py36_0         146 KB
        c-ares-1.15.0              |       h7b6447c_1          98 KB
        pip-19.0.3                 |           py36_0         1.9 MB
        keras-applications-1.0.6   |           py36_0          49 KB
        mkl_random-1.0.2           |   py36hd81dba3_0         407 KB
        markdown-3.0.1             |           py36_0         107 KB
        mkl_fft-1.0.10             |   py36ha843d7b_0         170 KB
        python-3.6.8               |       h0371630_0        34.4 MB
        scipy-1.2.1                |   py36h7c811a0_0        17.7 MB
        tensorboard-1.12.2         |   py36he6710b0_0         3.1 MB
        gast-0.2.2                 |           py36_0         138 KB
        absl-py-0.7.0              |           py36_0         156 KB
        keras-preprocessing-1.0.5  |           py36_0          52 KB
        ca-certificates-2019.1.23  |                0         126 KB
        tensorflow-base-1.12.0     |mkl_py36h3c3e929_0        98.5 MB
        openssl-1.1.1b             |       h7b6447c_0         4.0 MB
        h5py-2.9.0                 |   py36h7918eee_0         1.2 MB
        numpy-1.15.4               |   py36h7e9f1db_0          47 KB
        hdf5-1.10.4                |       hb1b8bf9_0         5.3 MB
        libedit-3.1.20181209       |       hc058e9b_0         188 KB
        _tflow_select-2.3.0        |              mkl           2 KB
        numpy-base-1.15.4          |   py36hde5b4d6_0         4.3 MB
        tensorflow-1.12.0          |mkl_py36h69b6ba0_0           4 KB
        libprotobuf-3.6.1          |       hd408876_0         4.1 MB
        grpcio-1.16.1              |   py36hf8bcb03_1         1.1 MB
        protobuf-3.6.1             |   py36he6710b0_0         616 KB
        ------------------------------------------------------------
                                               Total:       178.9 MB
    
    The following NEW packages will be INSTALLED:
    
        _tflow_select:       2.3.0-mkl                
        absl-py:             0.7.0-py36_0             
        astor:               0.7.1-py36_0             
        blas:                1.0-mkl                  
        c-ares:              1.15.0-h7b6447c_1        
        ca-certificates:     2019.1.23-0              
        certifi:             2018.11.29-py36_0        
        gast:                0.2.2-py36_0             
        grpcio:              1.16.1-py36hf8bcb03_1    
        h5py:                2.9.0-py36h7918eee_0     
        hdf5:                1.10.4-hb1b8bf9_0        
        intel-openmp:        2019.1-144               
        keras-applications:  1.0.6-py36_0             
        keras-preprocessing: 1.0.5-py36_0             
        libedit:             3.1.20181209-hc058e9b_0  
        libffi:              3.2.1-hd88cf55_4         
        libgcc-ng:           8.2.0-hdf63c60_1         
        libgfortran-ng:      7.3.0-hdf63c60_0         
        libprotobuf:         3.6.1-hd408876_0         
        libstdcxx-ng:        8.2.0-hdf63c60_1         
        markdown:            3.0.1-py36_0             
        mkl:                 2019.1-144               
        mkl_fft:             1.0.10-py36ha843d7b_0    
        mkl_random:          1.0.2-py36hd81dba3_0     
        ncurses:             6.1-he6710b0_1           
        numpy:               1.15.4-py36h7e9f1db_0    
        numpy-base:          1.15.4-py36hde5b4d6_0    
        openssl:             1.1.1b-h7b6447c_0        
        pip:                 19.0.3-py36_0            
        protobuf:            3.6.1-py36he6710b0_0     
        python:              3.6.8-h0371630_0         
        readline:            7.0-h7b6447c_5           
        scipy:               1.2.1-py36h7c811a0_0     
        setuptools:          40.8.0-py36_0            
        six:                 1.12.0-py36_0            
        sqlite:              3.26.0-h7b6447c_0        
        tensorboard:         1.12.2-py36he6710b0_0    
        tensorflow:          1.12.0-mkl_py36h69b6ba0_0
        tensorflow-base:     1.12.0-mkl_py36h3c3e929_0
        termcolor:           1.1.0-py36_1             
        tk:                  8.6.8-hbc83047_0         
        werkzeug:            0.14.1-py36_0            
        wheel:               0.33.1-py36_0            
        xz:                  5.2.4-h14c3975_4         
        zlib:                1.2.11-h7b6447c_3        
    
    Proceed ([y]/n)? y
    
    
    Downloading and Extracting Packages
      (省 略)
    
    
  2.   

  3. TensorFlow 動作確認
    [tsflow@localhost ~]$ conda activate tensorflow_env
    (tensorflow_env) [tsflow@localhost ~]$ python
    Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
    [GCC 7.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >;>;>; import tensorflow as tf
    >;>;>; hello = tf.constant('Hello TensorFlow')
    >;>;>; sess = tf.Session()
    2019-03-01 17:05:01.345278: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
    2019-03-01 17:05:01.355756: I tensorflow/core/common_runtime/process_util.cc:69] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
    >;>;>; print(sess.run(hello))
    b'Hello TensorFlow'
    >;>;>; a = tf.constant(10)
    >;>;>; b = tf.constant(16)
    >;>;>; print(sess.run(a+b))
    26
    >;>;>; exit()
    (tensorflow_env) [tsflow@localhost ~]$ 
    
    (tensorflow_env) [tsflow@localhost ~]$ 
    (tensorflow_env) [tsflow@localhost ~]$ 
    (tensorflow_env) [tsflow@localhost ~]$ conda install jupyter
    Solving environment: done 
    

      

Python データ解析環境 インストール

  1. Jupyter
  2. (tensorflow_env) [tsflow@localhost ~]$ conda install jupyter
    Solving environment: done
    
    
    ==>; WARNING: A newer version of conda exists. <==
      current version: 4.5.12
      latest version: 4.6.7
    
    Please update conda by running
    
        $ conda update -n base -c defaults conda
    
    
    
    ## Package Plan ##
    
      environment location: /home/tsflow/anaconda3/envs/tensorflow_env
    
      added / updated specs: 
        - jupyter
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        python-dateutil-2.8.0      |           py36_0         281 KB
        decorator-4.3.2            |           py36_0          17 KB
        mistune-0.8.4              |   py36h7b6447c_0          54 KB
        sip-4.19.8                 |   py36hf484d3e_0         290 KB
        jedi-0.13.3                |           py36_0         236 KB
        pandoc-2.2.3.2             |                0        20.8 MB
        nbformat-4.4.0             |           py36_0         141 KB
        jsonschema-2.6.0           |           py36_0          62 KB
        testpath-0.4.2             |           py36_0          91 KB
        markupsafe-1.1.1           |   py36h7b6447c_0          29 KB
        libxml2-2.9.9              |       he19cac6_0         2.0 MB
        qtconsole-4.4.3            |           py36_0         157 KB
        parso-0.3.4                |           py36_0         121 KB
        zeromq-4.3.1               |       he6710b0_3         666 KB
        dbus-1.13.6                |       h746ee38_0         587 KB
        pyqt-5.9.2                 |   py36h05f1152_2         5.6 MB
        ptyprocess-0.6.0           |           py36_0          23 KB
        ipython_genutils-0.2.0     |           py36_0          39 KB
        jupyter_core-4.4.0         |           py36_0          63 KB
        jupyter_client-5.2.4       |           py36_0         128 KB
        send2trash-1.5.0           |           py36_0          16 KB
        tornado-5.1.1              |   py36h7b6447c_0         663 KB
        prometheus_client-0.6.0    |           py36_0          70 KB
        ipykernel-5.1.0            |   py36h39e3cac_0         156 KB
        pexpect-4.6.0              |           py36_0          77 KB
        widgetsnbextension-3.4.2   |           py36_0         1.7 MB
        ipywidgets-7.4.2           |           py36_0         151 KB
        bleach-3.1.0               |           py36_0         226 KB
        jupyter-1.0.0              |           py36_7           6 KB
        jupyter_console-6.0.0      |           py36_0          35 KB
        pyzmq-18.0.0               |   py36he6710b0_0         518 KB
        wcwidth-0.1.7              |           py36_0          25 KB
        pandocfilters-1.4.2        |           py36_1          13 KB
        notebook-5.7.4             |           py36_0         7.2 MB
        libpng-1.6.36              |       hbc83047_0         346 KB
        prompt_toolkit-2.0.9       |           py36_0         493 KB
        jinja2-2.10                |           py36_0         184 KB
        entrypoints-0.3            |           py36_0          12 KB
        nbconvert-5.3.1            |           py36_0         406 KB
        pickleshare-0.7.5          |           py36_0          13 KB
        webencodings-0.5.1         |           py36_1          19 KB
        terminado-0.8.1            |           py36_1          21 KB
        traitlets-4.3.2            |           py36_0         133 KB
        backcall-0.1.0             |           py36_0          19 KB
        pygments-2.3.1             |           py36_0         1.4 MB
        ipython-7.3.0              |   py36h39e3cac_0         1.1 MB
        ------------------------------------------------------------
                                               Total:        46.1 MB
    
    The following NEW packages will be INSTALLED:
    
        backcall:           0.1.0-py36_0         
        bleach:             3.1.0-py36_0         
        dbus:               1.13.6-h746ee38_0    
        decorator:          4.3.2-py36_0         
        entrypoints:        0.3-py36_0           
        expat:              2.2.6-he6710b0_0     
        fontconfig:         2.13.0-h9420a91_0    
        freetype:           2.9.1-h8a8886c_1     
        glib:               2.56.2-hd408876_0    
        gmp:                6.1.2-h6c8ec71_1     
        gst-plugins-base:   1.14.0-hbbd80ab_1    
        gstreamer:          1.14.0-hb453b48_1    
        icu:                58.2-h9c2bf20_1      
        ipykernel:          5.1.0-py36h39e3cac_0 
        ipython:            7.3.0-py36h39e3cac_0 
        ipython_genutils:   0.2.0-py36_0         
        ipywidgets:         7.4.2-py36_0         
        jedi:               0.13.3-py36_0        
        jinja2:             2.10-py36_0          
        jpeg:               9b-h024ee3a_2        
        jsonschema:         2.6.0-py36_0         
        jupyter:            1.0.0-py36_7         
        jupyter_client:     5.2.4-py36_0         
        jupyter_console:    6.0.0-py36_0         
        jupyter_core:       4.4.0-py36_0         
        libpng:             1.6.36-hbc83047_0    
        libsodium:          1.0.16-h1bed415_0    
        libuuid:            1.0.3-h1bed415_2     
        libxcb:             1.13-h1bed415_1      
        libxml2:            2.9.9-he19cac6_0     
        markupsafe:         1.1.1-py36h7b6447c_0 
        mistune:            0.8.4-py36h7b6447c_0 
        nbconvert:          5.3.1-py36_0         
        nbformat:           4.4.0-py36_0         
        notebook:           5.7.4-py36_0         
        pandoc:             2.2.3.2-0            
        pandocfilters:      1.4.2-py36_1         
        parso:              0.3.4-py36_0         
        pcre:               8.42-h439df22_0      
        pexpect:            4.6.0-py36_0         
        pickleshare:        0.7.5-py36_0         
        prometheus_client:  0.6.0-py36_0         
        prompt_toolkit:     2.0.9-py36_0         
        ptyprocess:         0.6.0-py36_0         
        pygments:           2.3.1-py36_0         
        pyqt:               5.9.2-py36h05f1152_2 
        python-dateutil:    2.8.0-py36_0         
        pyzmq:              18.0.0-py36he6710b0_0
        qt:                 5.9.7-h5867ecd_1     
        qtconsole:          4.4.3-py36_0         
        send2trash:         1.5.0-py36_0         
        sip:                4.19.8-py36hf484d3e_0
        terminado:          0.8.1-py36_1         
        testpath:           0.4.2-py36_0         
        tornado:            5.1.1-py36h7b6447c_0 
        traitlets:          4.3.2-py36_0         
        wcwidth:            0.1.7-py36_0         
        webencodings:       0.5.1-py36_1         
        widgetsnbextension: 3.4.2-py36_0         
        zeromq:             4.3.1-he6710b0_3     
    
    Proceed ([y]/n)? y
    
    Downloading and Extracting Packages
    
         (省 略)
    
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    

     

  3. nb_conda
    (tensorflow_env) [tsflow@localhost ~]$ conda install nb_conda
    Solving environment: done
    
    
    ==>; WARNING: A newer version of conda exists. <==
      current version: 4.5.12
      latest version: 4.6.7
    
    Please update conda by running
    
        $ conda update -n base -c defaults conda
    
    
    
    ## Package Plan ##
    
      environment location: /home/tsflow/anaconda3/envs/tensorflow_env
    
      added / updated specs: 
        - nb_conda
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        nb_conda_kernels-2.2.0     |           py36_1          37 KB
        nb_conda-2.2.1             |           py36_0          33 KB
        ------------------------------------------------------------
                                               Total:          70 KB
    
    The following NEW packages will be INSTALLED:
    
        nb_conda:         2.2.1-py36_0
        nb_conda_kernels: 2.2.0-py36_1
    
    Proceed ([y]/n)? y
    
    
    Downloading and Extracting Packages
    nb_conda_kernels-2.2 | 37 KB     |                                                                                  |   0% 
    nb_conda_kernels-2.2 | 37 KB     | ################################################################################ | 100% 
    nb_conda-2.2.1       | 33 KB     |                                                                                  |   0% 
    nb_conda-2.2.1       | 33 KB     | ################################################################################ | 100% 
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: / + /home/tsflow/anaconda3/envs/tensorflow_env/bin/python -m nb_conda_kernels.install --enable
    Enabling nb_conda_kernels...
    Status: enabled
    
    | + /home/tsflow/anaconda3/envs/tensorflow_env/bin/jupyter-nbextension enable nb_conda --py --sys-prefix
    Enabling notebook extension nb_conda/main...
          - Validating: OK
    Enabling tree extension nb_conda/tree...
          - Validating: OK
    + /home/tsflow/anaconda3/envs/tensorflow_env/bin/jupyter-serverextension enable nb_conda --py --sys-prefix
    Enabling: nb_conda
    - Writing config: /home/tsflow/anaconda3/envs/tensorflow_env/etc/jupyter
        - Validating...
          nb_conda 2.2.1 OK
    
    done
    (tensorflow_env) [tsflow@localhost ~]$ 
    
  4.  

  5. jupyter notebook 
    (base) [tsflow@localhost ~]$ 
    (base) [tsflow@localhost ~]$ jupyter notebook
    [I 17:13:13.590 NotebookApp] Writing notebook server cookie secret to /run/user/1001/jupyter/notebook_cookie_secret
    [I 17:13:13.793 NotebookApp] JupyterLab extension loaded from /home/tsflow/anaconda3/lib/python3.7/site-packages/jupyterlab
    [I 17:13:13.793 NotebookApp] JupyterLab application directory is /home/tsflow/anaconda3/share/jupyter/lab
    [I 17:13:13.795 NotebookApp] Serving notebooks from local directory: /home/tsflow
    [I 17:13:13.795 NotebookApp] The Jupyter Notebook is running at:
    [I 17:13:13.795 NotebookApp] http://localhost:8888/?token=debe53d21f02238b23e41ff42bc028265177608f067dc899
    [I 17:13:13.795 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    [W 17:13:13.798 NotebookApp] No web browser found: could not locate runnable browser.
    [C 17:13:13.798 NotebookApp] 
        
        To access the notebook, open this file in a browser:
            file:///run/user/1001/jupyter/nbserver-30208-open.html
        Or copy and paste one of these URLs:
            http://localhost:8888/?token=debe53d21f02238b23e41ff42bc028265177608f067dc899
    

  

参考: Condaをupdate( 4.5.12 -> 4.6.7)

[tsflow@server01 ~]$ conda -V
conda 4.5.12
[tsflow@server01 ~]$ conda update -n base -c defaults conda
Solving environment: done

## Package Plan ##

  environment location: /home/tsflow/anaconda3

  added / updated specs: 
    - conda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.6.7                |           py37_0         1.7 MB

The following packages will be UPDATED:

    conda: 4.5.12-py37_0 --> 4.6.7-py37_0

Proceed ([y]/n)? y


Downloading and Extracting Packages
conda-4.6.7          | 1.7 MB    |                                                                                         |   0% 
conda-4.6.7          | 1.7 MB    | ############################3                                                           |  33% 
conda-4.6.7          | 1.7 MB    | #################################################################6                      |  75% 
conda-4.6.7          | 1.7 MB    | ##################################################################################7     |  95% 
conda-4.6.7          | 1.7 MB    | ####################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) [tsflow@server01 ~]$ conda -V
conda 4.6.7
(base) [tsflow@server01 ~]$ 

  
  


Post a Comment