Giter Club home page Giter Club logo

Comments (8)

KeSyren avatar KeSyren commented on May 6, 2024

I have the same problem.

from models.

mrry avatar mrry commented on May 6, 2024

Have you got an old version of TensorFlow (earlier than 0.8) installed on your machine?

from models.

loretoparisi avatar loretoparisi commented on May 6, 2024

@mrry so I have installed the '0.8' through pip:

sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl

from models.

mrry avatar mrry commented on May 6, 2024

Can you print the results of import tensorflow as tf; print tf.__version__; print dir(tf)?

from models.

loretoparisi avatar loretoparisi commented on May 6, 2024

@mrry uhm it seems to be an tensorflow install problem I have tried from source again:

git clone --recurse-submodules https://github.com/tensorflow/tensorflow
cd tensorflow
./configure
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-0.8.0-py2-none-any.whl
bazel build -c opt //tensorflow/cc:tutorials_example_trainer

after some hourse I have got

INFO: From Linking tensorflow/cc/ops/image_ops_gen_cc [for host]:
clang: warning: argument unused during compilation: '-pthread'
INFO: From Compiling tensorflow/core/kernels/mirror_pad_op.cc:
In file included from tensorflow/core/kernels/mirror_pad_op.cc:20:
In file included from ./tensorflow/core/kernels/mirror_pad_op.h:19:
In file included from ./third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:
In file included from external/eigen_archive/eigen-eigen-a5e9085a94e8/unsupported/Eigen/CXX11/Tensor:57:
In file included from external/eigen_archive/eigen-eigen-a5e9085a94e8/unsupported/Eigen/CXX11/ThreadPool:53:
external/eigen_archive/eigen-eigen-a5e9085a94e8/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h:183:10: warning: private field 'pad_' is not used [-Wunused-private-field]
    char pad_[128];
         ^
1 warning generated.
INFO: From Linking tensorflow/cc/tutorials_example_trainer:
clang: warning: argument unused during compilation: '-pthread'
Target //tensorflow/cc:tutorials_example_trainer up-to-date:
  bazel-bin/tensorflow/cc/tutorials_example_trainer
INFO: Elapsed time: 1300,997s, Critical Path: 1297,02s

but no way to import in python:

>>> import tensorflow 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "tensorflow/python/__init__.py", line 48, in <module>
    from tensorflow.python import pywrap_tensorflow
ImportError: cannot import name pywrap_tensorflo

from models.

mrry avatar mrry commented on May 6, 2024

Are you running python from inside the tensorflow/ source directory? That would explain the ImportError.

from models.

loretoparisi avatar loretoparisi commented on May 6, 2024

@mrry ok I guess the error seems to be protobuf

Runnig within the tensorflow/ root folder I get the error before - you were right, but running from the source directory I get this error, that I think it's the problem:

macbookproloreto:tensorflow admin$ cd tensorflow/
macbookproloreto:tensorflow admin$ python
Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 55, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: No module named protobuf


Error importing tensorflow.  Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
>>>

from models.

slavpetrov avatar slavpetrov commented on May 6, 2024

Were you able to resolve this or are you still having trouble? I am going to close the issue but feel free to reopen if the problem is not resolved.

from models.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.