Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception Error Installing Tensorflow #24

Closed
CriticalFlaw opened this issue Jul 23, 2018 · 5 comments
Closed

Exception Error Installing Tensorflow #24

CriticalFlaw opened this issue Jul 23, 2018 · 5 comments

Comments

@CriticalFlaw
Copy link

CriticalFlaw commented Jul 23, 2018

I've been following EdjeElectronics' tutorial on how to setup Tensorflow on my Raspberry Pi 1B. However I haven't gotten far as I get exception errors when issuing the following command to run the installation

sudo pip3 install /home/pi/tf/tensorflow-1.8.0-cp35-none-linux_armv6l.whl

Any help with this would be greatly appreciated!

Processing ./tensorflow-1.8.0-cp35-none-linux_armv6l.whl
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 715, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 617, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 502, in unzip_file
    zip = zipfile.ZipFile(zipfp, allowZip64=True)
  File "/usr/lib/python3.5/zipfile.py", line 1026, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.5/zipfile.py", line 1094, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
@lhelontra
Copy link
Owner

Hi,
I tested on my rpi-zero, probably your whl file was corrupted.
Checks the md5 of whl file:

# download whl file
wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.8.0/tensorflow-1.8.0-cp35-none-linux_armv6l.whl -P /tmp/

# checks the md5 of file
md5sum /tmp/tensorflow-1.8.0-cp35-none-linux_armv6l.whl

# expected results:
e6e5a442769dbc9dc6b2b7b7666f1dd5  tensorflow-1.8.0-cp35-none-linux_armv6l.whl

# if ok, try install package
sudo pip3 install  /tmp/tensorflow-1.8.0-cp35-none-linux_armv6l.whl

@CriticalFlaw
Copy link
Author

Thanks! No idea why all the previous downloads ended up corrupt but at least it's doing the installation now. It's been stuck on Running setup.py bdist_wheel for numpy ... for a few hours now, either it's just being really slow or I'll need to restart the process.

@lhelontra
Copy link
Owner

hmm... numpy probably is compiling. If you wants test the whl file, install tensorflow without dependencies and install numpy package via apt-get:

sudo pip3 install --no-deps /tmp/tensorflow-1.8.0-cp35-none-linux_armv6l.whl
sudo apt-get update && apt-get install python3-numpy

@liuqun
Copy link
Contributor

liuqun commented Jul 24, 2018

@CriticalFlaw

pip install numpy used to take ages, and now it’s super fast if you update to any resent version of Raspbian or in old version of Raspbian you may type:

sudo pip3 install numpy --extra-index-url https://www.piwheels.org/simple

See: https://www.raspberrypi.org/blog/piwheels/


https://www.tensorflow.org/install/install_raspbian suggest us to install libatlas, because:

Atlas is a linear algebra library that numpy depends on, and so needs to be installed before TensorFlow. To add it to your system, run the following command:
sudo apt-get install libatlas-base-dev

But I prefer apt-get install libatlas3-base without the dev headers. It works for me either.

@CriticalFlaw
Copy link
Author

Thanks again, I'm continuing to go through the installation without any issues (so far). Things are taking a while but it's all good and not related tensorflow anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants