Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Gert_Lindner
Beginner
607 Views

Deep Neural Network Library (DNNL), Installing Tensorflow (Binary)

Target Mac: 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64

1) I Installed the  latest Intel® Optimization for TensorFlow* from Anaconda* Cloud successfully "conda install tensorflow"

https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide#Anaco...

2) but the proposed sanity check 

python -c "import tensorflow; print(tensorflow.pywrap_tensorflow.IsMklEnabled())"

failed with

File "<string>", line 1, in <module>

AttributeError: module 'tensorflow' has no attribute 'pywrap_tensorflow'

 

0 Kudos
6 Replies
Gert_Lindner
Beginner
607 Views

Attached the whole installation procedure

ChithraJ_Intel
Moderator
607 Views

    Hi,

    Thanks for reaching out to us.
    Could you please check the tensorflow version installed by using the command

    python -c "import tensorflow; print(tensorflow.__version__)"

    If it is tensorflow 2.0.0(latest version), please try to install stable tensorflow version 1.14.0 by uninstalling the current version.
    conda uninstall tensorflow

    Please follow the below commands to install intel-optimized-tensoflow from anaconda channel
    conda create -n tf-conda python=3.6
    conda install tensorflow==1.14.0 -c anaconda

    If you still faces any issue, please feel free to get back to us.

Gert_Lindner
Beginner
607 Views

Thank you for guided steps. I received the results described in the attachement.

 

ChithraJ_Intel
Moderator
607 Views

Hey Gert,

Could you please confirm whether you are facing the same issue with tensorflow version 1.14.0

[ Run this command to check it: python -c "import tensorflow; print(tensorflow.pywrap_tensorflow.IsMklEnabled())" ]

Actually, this error is due to the tensorflow's version change to 2.0 has changed the tensorflow API structure significantly. 
If you are planning to use tensorflow 2.0.0 in future, to check if MKL-DNN is enabled ( in tensorflow 2.0.0 ) , please use the below command(instead of the sanity check command in your answer)

python -c "from tensorflow.python import pywrap_tensorflow; print(pywrap_tensorflow.IsMklEnabled())"

you may not face this issue in earlier versions of tensorflow upto tensorflow 1.14.0

Gert_Lindner
Beginner
607 Views

Hi Chitra,

Yes I got ''True'

at the end of a long tail of "FutureWarning"

 

 

python -c "import tensorflow; print(tensorflow.pywrap_tensorflow.IsMklEnabled())"

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_qint8 = np.dtype([("qint8", np.int8, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_qint16 = np.dtype([("qint16", np.int16, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_qint32 = np.dtype([("qint32", np.int32, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  np_resource = np.dtype([("resource", np.ubyte, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_qint8 = np.dtype([("qint8", np.int8, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_qint16 = np.dtype([("qint16", np.int16, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  _np_qint32 = np.dtype([("qint32", np.int32, 1)])

/Users/lindne03/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

  np_resource = np.dtype([("resource", np.ubyte, 1)])

True

ChithraJ_Intel
Moderator
607 Views

Hi,

Thanks for the confirmation. We are closing this case. Please feel free to raise a new thread for further issues.

Reply