Apple Silicon m1 can't importing sklearn - tensorflow

I have been finished install Tensorflow env step by step from "https://developer.apple.com/metal/tensorflow-plugin/"
Tf is working!numpy is working! scipy is working!
but when i import sklearn package, have an error message like this:
ImportError: dlopen(/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/qhull.cpython-39-darwin.so, 0x0002): Library not loaded: #rpath/liblapack.3.dylib
Referenced from: /Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/qhull.cpython-39-darwin.so
Reason: tried: '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/../../../../liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/../../../../liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/bin/../lib/liblapack.3.dylib' (no such file), '/Users/mecilmeng/miniforge3/envs/tf/bin/../lib/liblapack.3.dylib' (no such file), '/usr/local/lib/liblapack.3.dylib' (no such file), '/usr/lib/liblapack.3.dylib' (no such file)
How to fix it?
pip list
Package Version
------------------------ -------------------
absl-py 0.10.0
aiohttp 3.8.1
aiosignal 1.2.0
anyio 3.5.0
appnope 0.1.2
argon2-cffi 20.1.0
astunparse 1.6.3
async-generator 1.10
async-timeout 4.0.1
attrs 21.4.0
Babel 2.9.1
backcall 0.2.0
beniget 0.3.0
bleach 4.1.0
blinker 1.4
Bottleneck 1.3.2
brotlipy 0.7.0
cached-property 1.5.2
cachetools 4.2.2
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.4
click 8.0.3
cryptography 3.4.7
cycler 0.11.0
Cython 0.29.28
debugpy 1.5.1
decorator 5.1.1
defusedxml 0.7.1
dill 0.3.4
entrypoints 0.3
flatbuffers 2.0
fonttools 4.25.0
frozenlist 1.2.0
gast 0.4.0
google-auth 1.33.0
google-auth-oauthlib 0.4.1
google-pasta 0.2.0
googleapis-common-protos 1.54.0
grpcio 1.42.0
h5py 3.1.0
idna 3.3
importlib-metadata 4.8.2
ipykernel 6.4.1
ipython 7.31.1
ipython-genutils 0.2.0
jedi 0.18.1
Jinja2 3.0.2
joblib 1.1.0
json5 0.9.6
jsonschema 3.2.0
jupyter-client 7.1.2
jupyter-core 4.9.1
jupyter-server 1.13.5
jupyterlab 3.2.1
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
keras 2.8.0
Keras-Preprocessing 1.1.2
kiwisolver 1.3.1
libclang 13.0.0
Markdown 3.3.4
MarkupSafe 2.0.1
matplotlib 3.5.0
matplotlib-inline 0.1.2
mistune 0.8.4
multidict 5.2.0
munkres 1.1.4
nbclassic 0.2.6
nbclient 0.5.3
nbconvert 6.3.0
nbformat 5.1.3
nest-asyncio 1.5.1
networkx 2.6.3
notebook 6.4.6
numexpr 2.8.1
numpy 1.22.2
oauthlib 3.1.1
opencv-python 4.5.5.62
opt-einsum 3.3.0
packaging 21.3
pandas 1.3.5
pandocfilters 1.5.0
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.0.1
pip 21.2.4
ply 3.11
prometheus-client 0.13.1
promise 2.3
prompt-toolkit 3.0.20
protobuf 3.19.1
ptyprocess 0.7.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pybind11 2.9.1
pycparser 2.21
Pygments 2.11.2
PyJWT 2.1.0
pyOpenSSL 21.0.0
pyparsing 3.0.4
pyrsistent 0.18.0
PySocks 1.7.1
python-dateutil 2.8.2
pythran 0.9.11
pytz 2021.3
pyzmq 22.3.0
requests 2.27.1
requests-oauthlib 1.3.0
rsa 4.7.2
scikit-learn 1.0.2
scipy 1.7.1
Send2Trash 1.8.0
setuptools 58.0.4
six 1.15.0
sklearn 0.0
sniffio 1.2.0
tensorboard 2.8.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.6.0
tensorflow-datasets 4.5.2
tensorflow-macos 2.8.0
tensorflow-metadata 1.6.0
tensorflow-metal 0.3.0
termcolor 1.1.0
terminado 0.13.1
testpath 0.5.0
tf-estimator-nightly 2.8.0.dev2021122109
threadpoolctl 2.2.0
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
typing-extensions 3.7.4.3
urllib3 1.26.8
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 0.58.0
Werkzeug 2.0.2
wheel 0.35.1
wrapt 1.12.1
yarl 1.6.3
zipp 3.7.0

You can install using Rosetta2 Mode.
To work in Rosetta Mode:
If Rosetta 2 is not installed by default in your M1 Mac, then open the pre-installed Terminal app and run the following command:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Rosetta allows us to use apps built for Mac with intel chip.
Several CLI tools do not have native versions built for the new M1 architecture.
Enabling them on your native M1 Mac terminal can be frustrating.
Follow these steps to enable Rosetta:
Select the app(Terminal) in the Finder.
Right click on the app(Terminal) and select Get Info.
In General, check the Open using Rosetta check-box.
Close the Terminal Info.
Now when you quit the terminal and open it again.
If you haven't installed Rosetta yet, then it would prompt you to install it.
If the popup shows up, then click on Install button, then enter your user name and password to allow installation to proceed.
Close the Terminal and open again.
Now we have a special terminal that can install tools with Rosetta translation.
To verify that you are using a Rosetta terminal, run the following command and it should output i386:
arch
The native terminal without Rosetta would output arm64 for the above command.
Moving forward, all commands we ask you to execute should be done in Rosetta enabled terminal.
Uninstall arm64 brew
If you have installed brew in the past from the native terminal, it is likely that you have an arm64 build of brew. Having two different builds of brew can cause major problems as the packages with different builds will not be compatible with each other.
To avoid this problem you need to uninstall your current installation of arm64 brew.
You can check which build you have by running the following command:
which brew
If your installation of brew is the Intel build, then the command should output /usr/local/bin/brew. If that is the case you can skip installing brew and just update your current installation by running brew update.
If your output is /opt/homebrew then your installation of brew is the arm64 build.
You need to uninstall the arm64 build of brew by running the following command from the native terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Install Intel brew
Install Homebrew, which is the package manager:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once done, run the below command to ensure that we make use of the HEAD revision:
git -C $(brew --repository homebrew/core) checkout master
Now verify the installation of the brew command:
which brew
The command should output /usr/local/bin/brew, which is the expected path.

Related

couldn't downgrade tensorflow in colab (just version 2 is available)

Colab does not allow to downgrade TensorFlow and says that only versions 2 is available.
here is code and output:
!pip install tensorflow-gpu==1.15.2
import tensorflow as tf
print(tf.__version__)
output:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.15.2 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0)
ERROR: No matching distribution found for tensorflow-gpu==1.15.2
2.9.2
I tried this code by creating some new projects in Colab but I got no new results
To downgrade tensorflow in google colab you must downgrade the version of python because python3.8 is not compatible with tensorflow1.x. So, Downgrade the version of python to python3.7 and install tensorflow1.x. This will work.
1.At first, Install python==3.7 version.
!sudo apt-get update -y
!sudo apt-get install python3.7
#change alternatives
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
#check python version
!python --version
The above code will install python3.7 version, but it is not mapped to colab kernel, so we must map newly installed python.
# install pip for python==3.7
!sudo apt-get install python3.7-distutils
!wget https://bootstrap.pypa.io/get-pip.py
!python get-pip.py
# install colab dependencies
!python -m pip install ipython ipython_genutils ipykernel jupyter_console prompt_toolkit httplib2 astor
# link to the old google package
!ln -s /usr/local/lib/python3.8/dist-packages/google \
/usr/local/lib/python3.7/dist-packages/google
Let's check version of python again, it will be python==3.7.16:
!python --version
Now, it's time to install tensorflow 1.x.
!pip install tensorflow==1.x
I hope that it will help to fix your issue.Thank you!

Why selenium install more modules?

Before all manipulation, i created new virtual environment, and watch pip list, his have two modules:
pip 21.2.3
setuptools 57.4.0
Why, after this command:
pip install selenium
I watch this list modules?:
async-generator 1.10
attrs 21.4.0
certifi 2022.6.15
cffi 1.15.0
cryptography 37.0.2
h11 0.13.0
idna 3.3
outcome 1.2.0
pip 21.2.3
pycparser 2.21
pyOpenSSL 22.0.0
PySocks 1.7.1
selenium 4.2.0
setuptools 57.4.0
sniffio 1.2.0
sortedcontainers 2.4.0
trio 0.21.0
trio-websocket 0.9.2
urllib3 1.26.9
wsproto 1.1.0
I'ts normal? If True, please, send link to this info

How to install tensorflow-text=2.8.*?

I want to install tensorflow-text with version of 2.8.x.
First when I use:
pip install tensorflow-text',
I can only installed the version of 2.6.x.
And then when I use:
pip install -U "tensorflow-text==2.8.*" ,
it said that:
ERROR: Could not find a version that satisfies the requirement
tensorflow-text==2.8.* (from versions: 0.1.0rc2, 0.1.0, 1.0.0b2,
1.15.0rc0, 1.15.1, 2.0.0rc0, 2.0.1, 2.1.0rc0, 2.2.0rc2, 2.2.0, 2.2.1, 2.3.0rc1, 2.3.0, 2.4.0b0, 2.4.0rc0, 2.4.0rc1, 2.4.1, 2.4.2, 2.4.3, 2.5.0rc0, 2.5.0, 2.6.0rc0, 2.6.0) ERROR: No matching distribution found for tensorflow-text==2.8.*

Google Cloud TPU: capture_tpu_profile: No trace event is collected after N attempt(s)

While following Cloud TPU profiling guide and Bert FineTuning, I got error when creating Profile data.
Scalars and Graphs in TensorBoards are working well.
Is there anything I'm missing?
Configurations
Zone: us-central1-a(Both for Storage and TPU)
TPU Type: v3-8
TPU software version: tpu-vm-tf-2.7.0
TPU Architecture: TPU VM
Error log
Using CLI
(Run when training is process)
> capture_tpu_profile --tpu=bert-tpu --logdir=${MODEL_DIR} --duration_ms=3000
2022-01-20 06:34:29.301737: I tensorflow/core/tpu/tpu_initializer_helper.cc:68] libtpu.so already in used by another process. Not attempting to load libtpu.so in this process.
2022-01-20 06:34:29.301787: I tensorflow/core/tpu/tpu_api_dlsym_initializer.cc:116] Libtpu path is: libtpu.so
WARNING: Logging before InitGoogle() is written to STDERR
I0120 06:34:29.324573 67944 tpu_initializer_helper.cc:68] libtpu.so already in used by another process. Not attempting to load libtpu.so in this process.
2022-01-20 06:34:29.336671: I tensorflow/core/tpu/tpu_initializer_helper.cc:68] libtpu.so already in used by another process. Not attempting to load libtpu.so in this process.
2022-01-20 06:34:31.607899: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (4 tries left)
2022-01-20 06:34:32.608170: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (3 tries left)
2022-01-20 06:34:33.608461: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (2 tries left)
2022-01-20 06:34:34.608757: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (1 tries left)
2022-01-20 06:34:35.609050: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:74] No TPU platform found.
TensorFlow version 2.7.0 detected
Welcome to the Cloud TPU Profiler v2.4.0
I0120 06:34:35.628104 140127504198720 discovery.py:280] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/tpu/v1/rest
I0120 06:34:35.709828 140127504198720 discovery.py:911] URL being requested: GET https://tpu.googleapis.com/v1/projects/elsa-270714/locations/us-central1-a/nodes/bert-tpu?alt=json
I0120 06:34:35.710047 140127504198720 transport.py:157] Attempting refresh to obtain initial access_token
I0120 06:34:35.710207 140127504198720 client.py:777] Refreshing access_token
I0120 06:34:35.806093 140127504198720 discovery.py:280] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/tpu/v1/rest
I0120 06:34:35.838788 140127504198720 discovery.py:911] URL being requested: GET https://tpu.googleapis.com/v1/projects/elsa-270714/locations/us-central1-a/nodes/bert-tpu?alt=json
I0120 06:34:35.838929 140127504198720 transport.py:157] Attempting refresh to obtain initial access_token
I0120 06:34:35.839013 140127504198720 client.py:777] Refreshing access_token
Starting to trace for 3000 ms. Remaining attempt(s): 2
No trace event is collected. Automatically retrying.
Starting to trace for 3000 ms. Remaining attempt(s): 1
No trace event is collected. Automatically retrying.
Starting to trace for 3000 ms. Remaining attempt(s): 0
No trace event is collected after 3 attempt(s). Perhaps, you want to try again (with more attempts?).
Tip: increase number of attempts with --num_tracing_attempts.
Using TensorBoard
(TPU name: bert-tpu)
Packages
> pip3 list
Package Version
--------------------------------- --------------------
absl-py 0.12.0
anyio 3.5.0
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asttokens 2.0.5
astunparse 1.6.3
attrs 19.3.0
Automat 0.8.0
Babel 2.9.1
backcall 0.2.0
backports.entry-points-selectable 1.1.1
black 21.12b0
bleach 4.1.0
blinker 1.4
cachetools 4.2.4
certifi 2021.10.8
cffi 1.15.0
chardet 3.0.4
charset-normalizer 2.0.7
click 8.0.3
cloud-init 21.4
cloud-tpu-client 0.10
cloud-tpu-profiler 2.4.0
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
constantly 15.1.0
cryptography 2.8
cycler 0.11.0
Cython 0.29.24
dbus-python 1.2.16
debugpy 1.5.1
decorator 5.1.1
defusedxml 0.7.1
dill 0.3.4
distlib 0.3.3
distro 1.4.0
distro-info 0.23ubuntu1
dm-tree 0.1.6
entrypoints 0.3
executing 0.8.2
filelock 3.4.0
flatbuffers 2.0
fonttools 4.28.5
future 0.18.2
gast 0.4.0
gin-config 0.5.0
google-api-core 1.31.4
google-api-python-client 1.8.0
google-auth 1.35.0
google-auth-httplib2 0.1.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
googleapis-common-protos 1.53.0
grpcio 1.42.0
gviz-api 1.10.0
h5py 3.6.0
httplib2 0.20.2
hyperlink 19.0.0
idna 3.3
importlib-metadata 4.8.2
importlib-resources 5.4.0
incremental 16.10.1
intel-openmp 2021.4.0
ipykernel 6.7.0
ipython 8.0.0
ipython-genutils 0.2.0
jax 0.2.25
jaxlib 0.1.74
jedi 0.18.1
Jinja2 2.10.1
joblib 1.1.0
json5 0.9.6
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
jupyter-client 7.1.1
jupyter-core 4.9.1
jupyter-server 1.13.3
jupyterlab 3.2.8
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
kaggle 1.5.12
keras 2.7.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.2
keyring 18.0.1
kiwisolver 1.3.2
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
libclang 12.0.0
Markdown 3.3.6
MarkupSafe 1.1.0
matplotlib 3.5.1
matplotlib-inline 0.1.3
mistune 0.8.4
mkl 2021.4.0
mkl-include 2021.4.0
mock 4.0.3
more-itertools 4.2.0
mypy-extensions 0.4.3
nbclassic 0.3.5
nbclient 0.5.10
nbconvert 6.4.0
nbformat 5.1.3
nest-asyncio 1.5.4
netifaces 0.10.4
notebook 6.4.7
numpy 1.18.5
oauth2client 4.1.3
oauthlib 3.1.0
opencv-python-headless 4.5.5.62
opt-einsum 3.3.0
packaging 21.3
pandas 1.3.5
pandocfilters 1.5.0
parso 0.8.3
pathspec 0.9.0
pexpect 4.6.0
pickleshare 0.7.5
Pillow 8.4.0
pip 21.3.1
platformdirs 2.4.0
portalocker 2.3.2
prometheus-client 0.12.0
promise 2.3
prompt-toolkit 3.0.24
protobuf 3.19.1
psutil 5.9.0
ptyprocess 0.7.0
pure-eval 0.2.1
py-cpuinfo 8.0.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycocotools 2.0.4
pycparser 2.21
Pygments 2.11.2
PyGObject 3.36.0
PyHamcrest 1.9.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyparsing 3.0.6
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.6
python-dateutil 2.8.2
python-debian 0.1.36ubuntu1
python-slugify 5.0.2
pytz 2021.3
PyYAML 5.4.1
pyzmq 22.3.0
regex 2022.1.18
requests 2.26.0
requests-oauthlib 1.3.0
requests-unixsocket 0.2.0
rsa 4.7.2
sacrebleu 2.0.0
scikit-learn 1.0.2
scipy 1.7.2
SecretStorage 2.3.1
Send2Trash 1.8.0
sentencepiece 0.1.96
seqeval 1.2.2
service-identity 18.1.0
setuptools 59.2.0
simplejson 3.16.0
six 1.16.0
sniffio 1.2.0
sos 4.1
ssh-import-id 5.10
stack-data 0.1.4
systemd-python 234
tabulate 0.8.9
tbb 2021.4.0
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-profile 2.5.0
tensorboard-plugin-wit 1.8.0
tensorflow 2.7.0
tensorflow-addons 0.15.0
tensorflow-datasets 4.4.0
tensorflow-estimator 2.7.0
tensorflow-hub 0.12.0
tensorflow-io-gcs-filesystem 0.22.0
tensorflow-metadata 1.5.0
tensorflow-model-optimization 0.7.0
tensorflow-text 2.7.0rc1
termcolor 1.1.0
terminado 0.12.1
testpath 0.5.0
text-unidecode 1.3
tf-slim 1.1.0
threadpoolctl 3.0.0
tomli 1.2.3
torch 1.11.0a0+git4635f57
torch-xla 1.11+73a3937
torchvision 0.12.0a0+59baae9
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
Twisted 18.9.0
typeguard 2.13.3
typing_extensions 4.0.0
ubuntu-advantage-tools 27.4
ufw 0.36
unattended-upgrades 0.1
uritemplate 3.0.1
urllib3 1.26.7
virtualenv 20.10.0
wadllib 1.3.3
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.2.3
Werkzeug 2.0.2
wheel 0.34.2
wrapt 1.13.3
zipp 3.7.0
zope.interface 4.7.1
Unfortunately capture_tpu_profile doesn't work with TPU VM.
If you're using TF2/Keras, one very accessible way is to use the TensorBoard Callback and set profile_batch=1 for instance. This would work for v3-8 but unfortunately wouldn't work for >v3-8.
Alternatively, you can use tf.profiler.experimental.start(...) and tf.profiler.experimental.stop() which is what the TensorBoard callback uses under the hood.
If you're using >v3-8 (for instance v3-32) you can use tf.profiler.experimental.client.trace() where service_addr is accessible from TPUClusterResolver's get_master() function.

Failed linking MKL when buildng TensorFlow

I try to build tensorflow v1.13 with MKL. The build is performed successfully, the pip package is correctly created, but when I test the package, MKL is clearly not used in the end, i.e. when I run in Python 3.6.8:
import tensorflow
print("Is MKL enabled?{}".format(tensorflow.pywrap_tensorflow.IsMklEnabled()))
It returns "False"
I am operating on CentOS 7 in the following conda environment:
# Name Version Build Channel
blas 1.0 mkl
ca-certificates 2019.1.23 0
certifi 2018.1.18 py36_2 intel
cloog 0.18.0 0
cython 0.29.6 py36he6710b0_0
gcc 4.8.5 7
gmp 6.1.2 h6c8ec71_1
icc_rt 2019.3 intel_199 intel
intel-openmp 2019.3 intel_199 intel
intelpython 2019.3 0 intel
isl 0.12.2 0
keras-applications 1.0.7 pypi_0 pypi
keras-preprocessing 1.0.9 pypi_0 pypi
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
libstdcxx-ng 8.2.0 hdf63c60_1
mkl 2019.3 intel_199 intel
mkl-dnn 0.14 2 intel
mkl_fft 1.0.11 py36h7b7c402_0 intel
mkl_random 1.0.2 py36h7b7c402_4 intel
mock 2.0.0 py36_0
mpc 1.0.3 hec55b23_5
mpfr 3.1.5 h11a74b3_2
ncurses 6.1 he6710b0_1
numpy 1.16.2 py36h7e9f1db_0
numpy-base 1.16.2 py36hde5b4d6_0
openmp 2018.0.3 intel_0 intel
openssl 1.1.1b h7b6447c_1
pbr 5.1.3 py_0
pip 19.0.3 py36_0
python 3.6.8 h0371630_0
readline 7.0 h7b6447c_5
setuptools 40.8.0 py36_0
six 1.12.0 py36_0
sqlite 3.27.2 h7b6447c_0
tbb 2019.4 intel_199 intel
tk 8.6.8 hbc83047_0
wheel 0.33.1 py36_0
xz 5.2.4 h14c3975_4
zlib 1.2.11 h7b6447c_3
Bazel is in version 0.23.0
GCC is in version 7.3.1 (see below)
I use the following command lines to build the tensorflow package:
scl enable devtoolset-7 bash
bazel build --config=mkl --config=opt --copt=-march=x86-64 --copt=-mavx --copt=-msse4.1 --copt=-msse4.2 --copt=-O2 --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" //tensorflow/tools/pip_package:build_pip_package
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Obviously, many warnings occur, but none of them is related to MKL. Noteworthy, I am using GCC7 here. I tried GCC4 and GCC5. I am using
That didn't change the problem. Does someone have a clue about why MKL is not linked?
As tensorflow version==1.13 is the latest release ,it might not be stable(https://www.tensorflow.org/versions/)
It worked fine installing with tensorflow version==1.11 using the below steps.
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
git checkout r1.11
conda create -n <conda_environment_name> python=3.6
source activate <conda_environment_name>
conda install numpy bazel
conda install -c intel mkl-dnn
conda install -c conda-forge keras-preprocessing
Configure your system build by running the following at the root of your TensorFlow source tree:
$./configure
bazel build command for Support for the Intel® MKL-DNN.
bazel build --config=mkl -c opt //tensorflow/tools/pip_package:build_pip_package
create a directory tfwheels to place the wheel files and run the below commands
mkdir tfwheels
bazel-bin/tensorflow/tools/pip_package/build_pip_package /home/<your_path>/tfwheels/tensorflow_pkg
pip install /home/<your_path>/tfweels/tensorflow_pkg/tensorflow-<version>-cp36-cp36m-linux_x86_64.whl
for tensorflow version==1.12(similar steps)
refer
https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide
Hope this helps.