c++ - Cannot run TensorFlow compiled with MKL -
i've compiled latest tensorflow on ubuntu 16.04 cuda , mkl so
bazel build --config=opt --cxxopt="-d_glibcxx_use_cxx11_abi=0" --config=mkl --config=cuda //tensorflow/tools/pip_package:build_pip_package
and when i'm trying run i'm getting error saying 1 of intel's libraries can't found. i've found other people who're installing different dnn framework struggling https://github.com/paddlepaddle/paddle/issues/3213 , found intel doc https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation says these files should become avilable when follow directions in doc far understood this. i've followed directions , seems have worked, in reality libmklml_intel.so
, libiomp5.so
files weren't added /usr/local/lib
.
>>> import tensorflow traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module> tensorflow.python import * file "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module> tensorflow.python import pywrap_tensorflow file "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module> raise importerror(msg) importerror: traceback (most recent call last): file "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module> tensorflow.python.pywrap_tensorflow_internal import * file "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() file "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) importerror: libmklml_intel.so: cannot open shared object file: no such file or directory
edit: actually, located in /mkl-dnn/external/mklml_lnx_2018.0.20170720/lib
after i've cloned mkl-dnn
git , followed directions in https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation
actually, libs located in /mkl-dnn/external/mklml_lnx_2018.0.20170720/lib
after i've cloned mkl-dnn git , followed directions in https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation
so copied them /usr/local/lib
, included folders in .bashrc
as
export library_path=/usr/local/lib:$library_path export ld_library_path=/usr/local/lib:$ld_library_path
and reloaded .bashrc
source ~/.bashrc
and tensorflow works.
Comments
Post a Comment