Getting started with artificial intelligence, TensorFlow environment installation guide

Pictures from the Internet

artificial intelligence [1] At present, the hottest technology has profoundly changed human social life and the world. City Lions can't fall behind the times, TensorFlow [2] It is an artificial intelligence development framework developed by Google for machine learning and deep neural network. Here's how to use Android TensorFlow framework.

hardware environment

  • Operating system: Ubuntu 17.04 x64 [3]
  • CPU: Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz
  • python: Python 2.7.13[4] , native to Ubuntu

setup script

  1. Download installation files tensorflow-0.8.0-cp27-none-linux_x86_64.whl
    Save the file to the path ~ / tensorflow / tensorflow-0.8.0-cp27-none-linux-x86-64.wh

  2. Preparing the virtuareenv environment [5]

# 1. Install Python virtualenv
$ sudo apt-get install python-pip python-dev python-virtualenv

#  2. Create virtualenv environment
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow

# 3. Perform installation
pip install --upgrade ./tensorflow-0.8.0-cp27-none-linux_x86_64.whl
  1. If all goes well, you'll see a process like this
pip install --upgrade ./tensorflow-0.8.0-cp27-none-linux_x86_64.whl --trusted-host
Processing ./tensorflow-0.8.0-cp27-none-linux_x86_64.whl
Collecting protobuf==3.0.0b2 (from tensorflow==0.8.0)
  Downloading (326kB)
    100% |████████████████████████████████| 327kB 1.9MB/s 
Collecting wheel (from tensorflow==0.8.0)
  Downloading (49kB)
    100% |████████████████████████████████| 51kB 624kB/s 
Requirement already up-to-date: numpy>=1.8.2 in /home/ethink/.local/lib/python2.7/site-packages (from tensorflow==0.8.0)
Requirement already up-to-date: six>=1.10.0 in /home/ethink/.local/lib/python2.7/site-packages (from tensorflow==0.8.0)
Collecting setuptools (from protobuf==3.0.0b2->tensorflow==0.8.0)
  Downloading (489kB)
    100% |████████████████████████████████| 491kB 1.6MB/s 
Installing collected packages: setuptools, protobuf, wheel, tensorflow
  Found existing installation: setuptools 32.3.1
    Uninstalling setuptools-32.3.1:
      Successfully uninstalled setuptools-32.3.1
  Found existing installation: wheel 0.29.0
    Uninstalling wheel-0.29.0:
      Successfully uninstalled wheel-0.29.0
Successfully installed protobuf-3.0.0b2 setuptools-38.2.4 tensorflow-0.8.0 wheel-0.30.0

OK, see the final success indicates success. Let's test it. The author encountered the error of "Could not find a version" during the actual installation. Please click to check resolvent.

Write a code test

$ python

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print

Could not find a version {ා myerror} encountered during installation

Problem Description:

Processing ./tensorflow-0.8.0-cp27-none-linux_x86_64.whl
Collecting protobuf==3.0.0b2 (from tensorflow==0.8.0)
  The repository located at is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host'.
  Could not find a version that satisfies the requirement protobuf==3.0.0b2 (from tensorflow==0.8.0) (from versions: )
No matching distribution found for protobuf==3.0.0b2 (from tensorflow==0.8.0)

Add the option. Here, the trusted host image is used

pip install --upgrade ./tensorflow-0.8.0-cp27-none-linux_x86_64.whl --trusted-host
  1. China's first scientific and technological media that pays systematic attention to artificial intelligence Heart of machine

  2. TensorFlow Chinese community

  3. Ubuntu domestic Download Image

  4. Python is an object-oriented interpreted programming language

  5. virtualenv a technology for managing different versions of Python environment Click to view

Tags: Python pip Ubuntu Google

Posted on Sun, 03 May 2020 07:12:23 -0700 by F.Danials