[英]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.我正在尝试在无法访问互联网的机器上安装 tensorflow:该机器有 Windows 7 和 Python 3.6 Anaconda。
I tried different approaches but non of them worked.我尝试了不同的方法,但都没有奏效。
This what i did so far:这是我到目前为止所做的:
But when I try to import tensorflow i get the following error:但是当我尝试导入 tensorflow 时,出现以下错误:
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...
我读过我应该安装
protobuf-3.6.tar.gz
但我收到错误:register_loader_type...
So I installed setuptools-3.6-py2.py3-none-any.whl
所以我安装了
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?所以我的问题是:有没有办法在离线计算机上安装 tensorflow 或者我做错了什么?
NOTE: I am admin on this offline machine注意:我是这台离线机器的管理员
python3 -m pip download tensorflow
on a machine with internet with the same OS. python3 -m pip download tensorflow
。 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
将文件移动到 USB 上,在没有互联网的情况下将 USB 挂载到设备上,然后执行
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.带有复制的
python3 -m pip install --no-index --find-links. tensorflow
文件的目录中的.whl
。
create anaconda conda virtul environment in some internet available system and install necessary package for your project and copy virtual environment to you system.在一些互联网可用系统中创建 anaconda conda virtul 环境并为您的项目安装必要的包并将虚拟环境复制到您的系统。 put inside anaconda env, it works
放入anaconda env中,它可以工作
Requirements:- Bazel Installation , python >=2.7 and numpy.要求:- Bazel安装,python >=2.7 和 numpy。
You can use link .您可以使用链接。 Installtion steps are given.
给出了安装步骤。 I am explaining in more briefly:-
我正在更简要地解释:-
git clone https://github.com/amutu/tensorflow-offline.git
git clone https://github.com/amutu/tensorflow-offline.git
tf=/path/to/tensorflow/directory
and tp=/path/to/tensorflow/third/party/directory
.(Note:- you can check path typing $tf and $tp on terminal.)tf=/path/to/tensorflow/directory
和tp=/path/to/tensorflow/third/party/directory
。(注意:- 您可以在终端上输入 $tf 和 $tp 检查路径。)tp=/home/ai/Documents/vineet/test/tensorflow_third_party-1.2.1
tf=/home/ai/Documents/vineet/test/tensorflow-1.2.1
tp=/home/ai/Documents/vineet/test/tensorflow_third_party-1.2.1
tf=/home/ai/Documents/vineet/test/tensorflow-1.2.1
Run:- cd tensorflow-offline
运行:-
cd tensorflow-offline
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)在 tensorlfow 离线运行中:-
./fix_offline_build.sh $tf $tp
。(注意:您可能还需要从此处下载 tensorflow-port 并在 tensorflow-port 目录中下载它)
cd $tf &&./configure
cd $tf &&./configure
bazel --config=opt //tensorflow/tools/pip_package:build_pip_package --verbose_failures
and bazel-bin/tensorflow/tools/pip_package/build_pip_package
bazel --config=opt //tensorflow/tools/pip_package:build_pip_package --verbose_failures
和bazel-bin/tensorflow/tools/pip_package/build_pip_package
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.