Jetson nano安装tensorflow及scipy“libraries mkl_rt not found“问题的解决

  目前最新的JetPack4.4, TensorFlow版本更新到2.1.0版本,并且由原来的TensorFlow-gpu更改为tensorflow…JetsonNano平台中只支持Python3.6的TensorFlow。

来源于微雪电子:Jetson Nano系列教程6:TensorFlow入门介绍(一)
①、登陆Jetson Nano,安装相关函数库;
注意:在输入第二个指令相关函数库的时候可能会由于网络延迟问题出现报错,如果有这种现象,建议你将指令拆开,手动一个个安装
  sudo apt-get update
  sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
②、更新一下pip3;
  sudo apt-get install python3-pip
  sudo pip3 install -U pip testresources setuptools
③、安装TensorFlow依赖库, 对应需求的版本注意对应TensorFlow版本查看对应需求的依赖库版本(点这里查询),如果由于网络延迟问题有中断的话,建议拆分指令一个一个安装;
  sudo pip3 install -U numpy1.16.1 future0.17.1 mock3.0.5 h5py2.9.0 keras_preprocessing1.0.5 keras_applications1.0.8 gast==0.2.2 futures protobuf pybind11
④、下载安装tensorflow. 截止到200515, 目前针对最新的JetPack4.4, TensorFlow版本更新到2.1.0版本,并且由原来的TensorFlow-gpu更改为tensorflow. 这里我们直接下载最新版本. 下载完成之后,可以import tensorflow测试一下;
  sudo pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow

安装Start…

sudo pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow

在这里插入图片描述
  但是在接下来的安装的时候总是在安装一个依赖的软件scipy的时候Fail,从打印的log中可以看出来多多少有些库没有安装好。所以接下来的首要任务是解决scipy的软件的依赖库问题,才能继续接下来TemsorFlow的安装。
在这里插入图片描述

lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']

  scipy是啥?其依赖的一些lib安装如下:

pip3 install Cython
sudo apt-get install gfortran
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev libblas-dev

  在安装这些依赖的lib时也遇到了一些问题liblapack-dev和libblas-dev已经不可用了 not available, but is referred to by another package.This may mean that the package is missing, has been obsoleted, or is only available from another source。多次即使update和upgrade之后还是相同的状况。只好试试换个源看看,当前使用的是中科大的源。

sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev libblas-dev
[sudo] password for colin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package liblapack-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libblas-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'liblapack-dev' has no installation candidate
E: Package 'libblas-dev' has no installation candidate

  更换软件更新源,五道口的源:

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe

  哟吼!Lib能找到。
在这里插入图片描述
  那接下来安装scipy。
在这里插入图片描述
  OK之后,再来一次安装TemsorFlow。

pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow

  安装成功,但是还是可能存在部分包依赖不兼容的问题,进行检查:We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before。

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

tensorflow-gpu 2.0.0+nv19.11.tf2 requires gast==0.2.2, but you'll have gast 0.3.3 which is incompatible.
tensorflow-gpu 2.0.0+nv19.11.tf2 requires tensorboard<2.1.0,>=2.0.0, but you'll have tensorboard 2.3.0 which is incompatible.
tensorflow-gpu 2.0.0+nv19.11.tf2 requires tensorflow-estimator<2.1.0,>=2.0.0, but you'll have tensorflow-estimator 2.3.0 which is incompatible.

在这里插入图片描述
在这里插入图片描述

pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow --use-feature=2020-resolver

  加上–use-feature=2020-resolver参数,再运行一次安装的cmd,此处主要是进行检查而不是重新安装,花不了多少时间。check结束之后,试试检查一下TemsorFlow的安装情况吧,打开python。

扫描二维码关注公众号,回复: 12786312 查看本文章
imort tensorflow

print(tf.__version__)

在这里插入图片描述

安装教程参考:
https://www.waveshare.net/study/article-889-1.html

猜你喜欢

转载自blog.csdn.net/qq_33475105/article/details/109555099