Jetson TX2 安装Tensorflow 

Note: As of the 20.02 TensorFlow release, the package name has changed from tensorflow-gpu to tensorflow. See the section on Upgrading TensorFlow for more information.

Install TensorFlow using the pip3 command. This command will install the latest version of TensorFlow compatible with JetPack 4.4.

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

Note: TensorFlow version 2 was recently released and is not fully backward compatible with TensorFlow 1.x. If you would prefer to use a TensorFlow 1.x package, it can be installed by specifying the TensorFlow version to be less than 2, as in the following command:

$ sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 ‘tensorflow<2’

If you want to install the latest version of TensorFlow supported by a particular version of JetPack, issue the following command:

$ sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v$JP_VERSION tensorflow

Jetson TX2 安装Tensorflow 出现Failed cleaning build dir for scipy

在ARM架构下的scipy本身就是一个很难安装的软件包

   利用pip3 install TensorFlow 的时候,出现了run scipy setup.py \.  然后蹦出来了Failed cleaning build dir for scipy

   查了好多资料,可以安装下面的依赖包,就可以成功的安装keras了

sudo apt-get install python3-scipy
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install gfortran

解决tensoflow2.x中使用tf.contrib.slim包时出现的No module named:tensorflow.contrib 问题


Tensorflow2.x 版本较1.x版本有了很大的变动,以使TensorFlow用户更加高效。其中 tf.contrib 被完全弃用了是 2.x版本的一个重大的变化,但 import tensorflow.contrib.slim as slim slim 作为一个高级封装,已经在很多之前的版本中广泛使用。现在大部分的源码还是以tensorflow1.x版本为基础写的,这导致了一些已经在2.x版本中移除的模块无法使用。

主要问题:在运行import tensorflow.contrib.slim as slim时
出现了:ModuleNotFoundError: No module named 'tensorflow.contrib 错误


解决方案


经查询现有的解决方案,大部分采用了降低版本的方法,如果想采用此方法可以自己去查询。
因为不想采用降低版本的方法进行解决,经过搜索在github中查询到此信息
链接: tf.contrib.slim is not worked in tensorflow 2.0 what is the alternative for that?.

Tf-slim 有一个独立于 tensorflow 的镜像可以以 tf.compat.v1 兼容模式下使用,安装该包即可

TF-Slim是一个轻量级的库,用于在TensorFlow中定义,训练和评估复杂的模型。tf-slim的组件可以与本机tensorflow以及其他框架自由混合。
这里可以查询到关于Slim的信息: link.
在cmd中使用pip下载TF-Slim

pip install --upgrade tf_slim


使用Slim库时注意:

#import tensorflow.contrib.slim as slim

import tf_slim as slim

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值