当前位置:   article > 正文

ARM64(aarch64)下安装tensorflow_tensorflow aarch64

tensorflow aarch64

首先从Github下载安装包:
tensorflow-on-arm
选择合适的版本,例如tensorflow-1.14.0-cp35-none-linux_aarch64.whl

  • 命名规则:cp35代表python3.5aarch64表示架构信息
wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.14.0/tensorflow-1.14.0-cp35-none-linux_aarch64.whl
pip install tensorflow-1.14.0-cp35-none-linux_aarch64.whl
  • 1
  • 2

Note:ARM64aarch64目前来看是一回事。

1. 如果提示如下错误

我是安装tensorflow-1.14.0-cp35-none-linux_aarch64.whl遇到如下问题: libhdf5.so: cannot open shared object file: No such file or directory

Loading library to get version: libhdf5.so
    error: libhdf5.so: cannot open shared object file: No such file or directory
  • 1
  • 2

那么需要安装hdf5(Ubuntu为例):

sudo apt install pkg-config libhdf5-103 libhdf5-dev
  • 1

然后就正常了:

Collecting h5py (from keras-applications>=1.0.6->tensorflow==1.14.0)
  Using cached https://files.pythonhosted.org/packages/5f/97/a58afbcf40e8abecededd9512978b4e4915374e5b80049af082f49cebe9a/h5py-2.10.0.tar.gz
Requirement already satisfied: markdown>=2.6.8 in /home/ubuntu/.pyenv/versions/3.5.10/envs/yolok210/lib/python3.5/site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0)
Requirement already satisfied: werkzeug>=0.11.15 in /home/ubuntu/.pyenv/versions/3.5.10/envs/yolok210/lib/python3.5/site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0)
Requirement already satisfied: setuptools>=41.0.0 in /home/ubuntu/.pyenv/versions/3.5.10/envs/yolok210/lib/python3.5/site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /home/ubuntu/.pyenv/versions/3.5.10/envs/yolok210/lib/python3.5/site-packages (from markdown>=2.6.8->tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0)
Requirement already satisfied: zipp>=0.5 in /home/ubuntu/.pyenv/versions/3.5.10/envs/yolok210/lib/python3.5/site-packages (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0)
Building wheels for collected packages: h5py
  Running setup.py bdist_wheel for h5py ... done
  Stored in directory: /home/ubuntu/.cache/pip/wheels/bd/4f/8e/a608fe814bb1b784ca1680e7fac3cc16b4e071a46275997e69
Successfully built h5py
Installing collected packages: h5py, keras-applications, tensorflow
Successfully installed h5py-2.10.0 keras-applications-1.0.8 tensorflow-1.14.0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

2. 如果提示如下错误

我是安装tensorflow-2.3.0-cp37-none-linux_aarch64.whl遇到了这个问题: libraries mkl_rt not found
在这里插入图片描述
那么需要安装如下依赖

pip3 install Cython
sudo apt-get install gfortran
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev libblas-dev
  • 1
  • 2
  • 3

然后就OK了

Successfully installed absl-py-1.0.0 astunparse-1.6.3 cachetools-5.0.0 certifi-2021.10.8 charset-normalizer-2.0.12 gast-0.3.3 google-auth-2.6.6 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 grpcio-1.46.0 h5py-2.10.0 idna-3.3 importlib-metadata-4.11.3 keras-preprocessing-1.1.2 markdown-3.3.7 numpy-1.18.5 oauthlib-3.2.0 opt-einsum-3.3.0 protobuf-3.20.1 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.27.1 requests-oauthlib-1.3.1 rsa-4.8 scipy-1.4.1 six-1.16.0 tensorboard-2.9.0 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorflow-2.3.0 tensorflow-estimator-2.3.0 termcolor-1.1.0 typing-extensions-4.2.0 urllib3-1.26.9 werkzeug-2.1.2 wheel-0.37.1 wrapt-1.14.1 zipp-3.8.0
  • 1

参考:

  1. 在ARM64平台下安装TensorFlow_lai_cheng的博客-CSDN博客_arm tensorflow
  2. ARM64 aarch64 3399开发板等 安装新版tensorflow,解决版本不兼容问题 - it610.com
  3. Ubuntu ARM64 安装 Tensorflow_swang09的博客-CSDN博客_arm安装tensorflow
  4. 为什么有的地方叫arm64,有的地方叫aarch64?
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/391329
推荐阅读
相关标签
  

闽ICP备14008679号