zoukankan      html  css  js  c++  java
  • TensorFlow在树莓派4B上安装后报错HadoopFileSystem load error的解决方法

    问题重现

    在树莓派上使用TensorFlow官方的命令安装完TensorFlow后用python测试是否安装成功:

    $ python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

    结果报出了如下错误:

    E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory

    问题原因

    不能安装1.14.0版本的Tensorflow,需要安装2.x.x或更高版本的TensorFlow

    解决方案

    不知道安装了什么版本的Tensorflow可以用以下命令查看安装的包

    sudo pip3 list

    然后卸载1.14.0版本的Tensorflow

    sudo pip3 uninstall tensorflow-estimator
    sudo pip3 uninstall tensorflow
    sudo pip3 uninstall tensorboard

    再安装2.x.x版本的TensorFlow(以2.3.0为例)

    sudo pip3 install https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.3.0/tensorflow-2.3.0-cp37-none-linux_armv7l.whl

    如果想安装最新版本的Tensorflow,可以查看这个github仓库Release:https://github.com/lhelontra/tensorflow-on-arm/releases

    根据你的树莓派版本找到对应的Assets,右键复制链接然后粘贴到命令sudo pip3 install后面

    安装完成后最后测试是否成功:

    python3 -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
    tf.Tensor(267.6587, shape=(), dtype=float32)

    引用的github issue comment: https://github.com/tensorflow/tensorflow/issues/36141#issuecomment-625958459

  • 相关阅读:
    Ubuntu 18.04安装gcc、g++ 4.8
    Java 接口返回值集合防止空指针
    Linux CentOS7.9环境下搭建Java Web 环境
    Springboot集成UReport2
    linux 环境中 单独执行 python 脚本
    sql 注入的问题
    检验上传文件的大小
    Gunicorn使用讲解
    CentOS下安装部署对象存储服务MinIO
    阿里云CentOS7安装MySQL
  • 原文地址:https://www.cnblogs.com/myhalo/p/13511715.html
Copyright © 2011-2022 走看看