在树莓派 pi3 上安装 TensorFlow 期间出现 HadoopFileSystem 加载错误 [英] HadoopFileSystem load error during TensorFlow installation on raspberry pi3

查看:51
本文介绍了在树莓派 pi3 上安装 TensorFlow 期间出现 HadoopFileSystem 加载错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

屏幕截图

因为 Python2.7 将于 2020 年 1 月 1 日弃用.我打算开始使用python3.所以,我尝试在树莓派上安装 tensorflow==1.14.0 并且成功了,但是当我加载 Tensorflow 以进行进一步操作时,它会引发加载错误.

As Python2.7 will be deprecated on 01/01/2020. I was planning to start using python3. So, I tried to install the tensorflow==1.14.0 on the raspberry pi and it was successful, but when I am loading the Tensorflow for further operations then it throws a load error.

Python - 3.7(Raspbian 操作系统默认安装)

Python - 3.7 (Default installed by Raspbian OS)

有什么建议为什么我会遇到这个问题?

Any suggestions why am I facing this issue?

感谢您的时间

推荐答案

您无法使用 pip 在 Raspberry Pi 上安装更高版本的 Tensorflow.您必须从源代码安装.我制作了一个视频:https://youtu.be/GNRg2P8Vqqs

You can't install later versions of Tensorflow on the Raspberry Pi using pip. You have to install from source. I made a video doing this: https://youtu.be/GNRg2P8Vqqs

安装 Tensorflow 需要在 Pi 的 ARM 架构上执行一些额外的步骤.

Installing Tensorflow requires some extra steps on the Pi's ARM architecture.

这是我在 Pi 4 上安装 tf 2.0 的方式:制作你的项目目录:

This is how I installed tf 2.0 on my Pi 4: Make your project directory:

cd Desktop
mkdir tf_pi
cd tf_pi

制作虚拟环境:

python3 -m pip install virtualenv
virtualenv env
source env/bin/activate

运行基于https://github.com/PINTO0309/Tensorflow-bin的命令/#usage:

sudo apt-get install -y libhdf5-dev libc-ares-dev libeigen3-dev
python3 -m pip install keras_applications==1.0.8 --no-deps
python3 -m pip install keras_preprocessing==1.1.0 --no-deps
python3 -m pip install h5py==2.9.0
sudo apt-get install -y openmpi-bin libopenmpi-dev
sudo apt-get install -y libatlas-base-dev
python3 -m pip install -U six wheel mock

https://github.com/lhelontra/tensorflow- 选择一个 tensorflow 版本on-arm/releases(我选择了 2.0.0).选择更高版本的 Tensorflow(如 2.1.0)需要更高版本的 scipy,它与我的 Raspberry Pi 不兼容:

Pick a tensorflow release from https://github.com/lhelontra/tensorflow-on-arm/releases (I picked 2.0.0). Picking a higher version of Tensorflow (like 2.1.0) requires a higher version of scipy that wasn't compatible with my Raspberry Pi:

wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.0.0/tensorflow-2.0.0-cp37-none-linux_armv7l.whl
python3 -m pip uninstall tensorflow
python3 -m pip install tensorflow-2.0.0-cp37-none-linux_armv7l.whl

重启你的终端

重新激活您的虚拟环境:

Reactivate your virtual environment:

cd Desktop
cd tf_pi
source env/bin/activate

测试:执行以下命令打开一个 python 解释器:

Test: Open a python interpreter by executing:

python3 
import tensorflow
tensor.__version__

这应该没有错误和输出:2.0.0

This should have no errors and output: 2.0.0

这篇关于在树莓派 pi3 上安装 TensorFlow 期间出现 HadoopFileSystem 加载错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆