简体   繁体   中英

How to install tensorflow on a offline computer

I am trying to install tensorflow on a machine with no internet access: the machine has Windows 7 and Python 3.6 Anaconda.

I tried different approaches but non of them worked.

This what i did so far:

  • install anaconda with python 3.6
  • pip install tensorflow tensorflow-1.3.0-cp36-cp36m-win_and64.whl

But when I try to import tensorflow i get the following error:

ModuleNotFoundError: No module name google

I have read that I should install protobuf-3.6.tar.gz but I get the error :register_loader_type...

So I installed setuptools-3.6-py2.py3-none-any.whl

and I still get the same error

So my question is: is there any way to install tensorflow on a offline computer or there is something that I did wrong?

NOTE: I am admin on this offline machine

python3 -m pip download tensorflow on a machine with internet with the same OS. You will download all the needed packages to the current directory. Move the files onto a USB, mount the USB on the device without internet, and then do python3 -m pip install --no-index --find-links. tensorflow python3 -m pip install --no-index --find-links. tensorflow in the directory with the copied .whl files.

create anaconda conda virtul environment in some internet available system and install necessary package for your project and copy virtual environment to you system. put inside anaconda env, it works

Requirements:- Bazel Installation , python >=2.7 and numpy.

You can use link . Installtion steps are given. I am explaining in more briefly:-

  1. clone repo:- git clone https://github.com/amutu/tensorflow-offline.git
  2. Download tensorflow and tensorflow third party .(Note:-you have to download compatible version of tensorflow with tensorflow third party.)
  3. unzip them. In terminal run:- tf=/path/to/tensorflow/directory and tp=/path/to/tensorflow/third/party/directory .(Note:- you can check path typing $tf and $tp on terminal.)
    Example:- tp=/home/ai/Documents/vineet/test/tensorflow_third_party-1.2.1 tf=/home/ai/Documents/vineet/test/tensorflow-1.2.1
  4. Run:- cd tensorflow-offline

  5. In tensorlfow offline run:- ./fix_offline_build.sh $tf $tp .(Note: you may also need to download tensorflow-port donwload it from here in tensorflow-port directory)

  6. Configure tensorflow using:- cd $tf &&./configure
  7. Build it using:- bazel --config=opt //tensorflow/tools/pip_package:build_pip_package --verbose_failures and bazel-bin/tensorflow/tools/pip_package/build_pip_package

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM