Поиск по этому блогу

четверг, 12 ноября 2015 г.

Неудачная установка TensorFlow на Windows - опять те же грабли.

Почему я упорно не пользую виртуальные машины. Давно ведь освоил VMware, но тупо устанавливаю все подрюд на основой рабочий Windows компьютер. Вот опять "между делом" загрузил ненужный мне сегодня TensorFlow, и неудачно ... Что теперь делать? Ждать...
Here's a little Python program that makes up some data in three dimensions, and then fits a plane to it. To use TensorFlow you need to understand how TensorFlow: •Represents computations as graphs. •Executes graphs in the context of Sessions. •Represents data as tensors. •Maintains state with Variables. •Uses feeds and fetches to get data into and out of arbitrary operations.


TensorFlowLet's get you up and running with TensorFlow!

But before we even get started, let's give you a sneak peak at what TensorFlow code looks like in the Python API, just so you have a sense of where we're headed.


Open source software library for numerical computation using data flow graphs http://tensorflow.org
MNIST For ML Beginners This tutorial is intended for readers who are new to both machine learning and TensorFlow. If you already know what MNIST is, and what softmax (multinomial logistic) regression is, you might prefer this faster paced tutorial.


Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications.

TensorFlow is a programming system in which you represent computations as graphs. Nodes in the graph are called ops (short for operations). An op takes zero or more Tensors, performs some computation, and produces zero or more Tensors. A Tensor is a typed multi-dimensional array. For example, you can represent a mini-batch of images as a 4-D array of floating point numbers with dimensions [batch, height, width, channels].

A TensorFlow graph is a description of computations. To compute anything, a graph must be launched in a Session. A Session places the graph ops onto Devices, such as CPUs or GPUs, and provides methods to execute them. These methods return tensors produced by ops as numpy ndarray objects in Python, and as tensorflow::Tensor instances in C and C++.

Установил и

In [ ]:
F:\stradorusite\images>pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-no
ne-any.whl
You are using pip version 7.0.3, however version 7.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Collecting tensorflow==0.5.0 from https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-non
e-any.whl
  Downloading https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl (9.8MB)
    100% |################################| 9.8MB 20kB/s
Collecting six>=1.10.0 (from tensorflow==0.5.0)
  Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.9.2 in c:\users\alter_000\anaconda\li
b\site-packages (from tensorflow==0.5.0)
Installing collected packages: six, tensorflow
  Found existing installation: six 1.9.0
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be remove
d in a future version. This is due to the fact that uninstalling a distutils project will only partially
 uninstall the project.
    Uninstalling six-1.9.0:
      Successfully uninstalled six-1.9.0
Successfully installed six-1.10.0 tensorflow-0.5.0

Вот всегда так, прихоидится софт обновлять между делом. PIPнул PIP

In [ ]:
F:\stradorusite\images>python -m pip install --upgrade pip
You are using pip version 7.0.3, however version 7.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Collecting pip
  Downloading pip-7.1.2-py2.py3-none-any.whl (1.1MB)
    100% |################################| 1.1MB 152kB/s
Installing collected packages: pip
  Found existing installation: pip 7.0.3
    Uninstalling pip-7.0.3:
      Successfully uninstalled pip-7.0.3
Successfully installed pip-7.1.2

F:\stradorusite\images>
In [ ]:
 
In [1]:
import tensorflow as tf
import numpy as np

# Make 100 phony data points in NumPy.
x_data = np.float32(np.random.rand(2, 100)) # Random input
y_data = np.dot([0.100, 0.200], x_data) + 0.300

# Construct a linear model.
b = tf.Variable(tf.zeros([1]))
W = tf.Variable(tf.random_uniform([1, 2], -1.0, 1.0))
y = tf.matmul(W, x_data) + b

# Minimize the squared errors.
loss = tf.reduce_mean(tf.square(y - y_data))
optimizer = tf.train.GradientDescentOptimizer(0.5)
train = optimizer.minimize(loss)

# For initializing the variables.
init = tf.initialize_all_variables()

# Launch the graph
sess = tf.Session()
sess.run(init)

# Fit the plane.
for step in xrange(0, 201):
    sess.run(train)
    if step % 20 == 0:
        print step, sess.run(W), sess.run(b)

# Learns best fit is W: [[0.100  0.200]], b: [0.300]
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-91c255a93c6b> in <module>()
----> 1 import tensorflow as tf
      2 import numpy as np
      3 
      4 # Make 100 phony data points in NumPy.
      5 x_data = np.float32(np.random.rand(2, 100)) # Random input

C:\Users\alter_000\Anaconda\lib\site-packages\tensorflow\__init__.pyc in <module>()
      2 # module.
      3 # pylint: disable=wildcard-import
----> 4 from tensorflow.python import *

C:\Users\alter_000\Anaconda\lib\site-packages\tensorflow\python\__init__.py in <module>()
     20 
     21 # Session
---> 22 from tensorflow.python.client.client_lib import *
     23 
     24 # Ops

C:\Users\alter_000\Anaconda\lib\site-packages\tensorflow\python\client\client_lib.py in <module>()
     33 """
     34 
---> 35 from tensorflow.python.client.session import InteractiveSession
     36 from tensorflow.python.client.session import Session
     37 

C:\Users\alter_000\Anaconda\lib\site-packages\tensorflow\python\client\session.py in <module>()
      9 import numpy as np
     10 
---> 11 from tensorflow.python import pywrap_tensorflow as tf_session
     12 from tensorflow.python.framework import errors
     13 from tensorflow.python.framework import ops

C:\Users\alter_000\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
     26                 fp.close()
     27             return _mod
---> 28     _pywrap_tensorflow = swig_import_helper()
     29     del swig_import_helper
     30 else:

C:\Users\alter_000\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in swig_import_helper()
     18             fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(__file__)])
     19         except ImportError:
---> 20             import _pywrap_tensorflow
     21             return _pywrap_tensorflow
     22         if fp is not None:

ImportError: No module named _pywrap_tensorflow
In [ ]:
F:\stradorusite\images>pip install -U six
Requirement already up-to-date: six in c:\users\alter_000\anaconda\lib\site-packages

First of all, I am an inexperienced with most things related to software engineer, so bear with me if the question is too simple.

On my windows desktop, I installed VMware. Inside the vmware, I installed Anaconda. then using the pip command I was able to install tensorflow. pip install .............. However when I tried to import it, the following error show up



Посты чуть ниже также могут вас заинтересовать

Комментариев нет: