从Tensorflow 0.12

时间:2017-07-23 15:34:01

标签: python-3.x tensorflow-gpu

我正在尝试学习如何使用tensorflow但是,我在使用python 3.5.2在Windows 10上运行最新版本的tensorflow-gpu时遇到了麻烦

我可以安装并运行tensorflow-gpu版本.12,它可以正确连接到cuda的5个库。

我查看了堆栈交换以找到我的问题的解决方案,但确实出现了一些问题,但它似乎无法正常工作。我已经尝试重新安装protobuf,但是没有用。

这是我得到的错误(向下滚动到错误的最后一行):

    Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\google\protobuf\__init__.py", line 37, in <module>
    __import__('pkg_resources').declare_namespace(__name__)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 3038, in <module>
    @_call_aside
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 3022, in _call_aside
    f(*args, **kwargs)
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 3066, in _initialize_master_working_set
    for dist in working_set
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 3066, in <genexpr>
    for dist in working_set
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 2597, in activate
    declare_namespace(pkg)
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 2165, in declare_namespace
    _handle_ns(packageName, path_item)
  File "F:\python35\lib\site-packages\pkg_resources\__init__.py", line 2100, in _handle_ns
    loader.load_module(packageName)
  File "C:\Users\Gal's\Desktop\stock_learning\google.py", line 2, in <module>
    from tensorflow.examples.tutorials.mnist import input_data
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\examples\tutorials\mnist\__init__.py", line 21, in <module>
    from tensorflow.examples.tutorials.mnist import input_data
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\examples\tutorials\mnist\input_data.py", line 29, in <module>
    from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\__init__.py", line 22, in <module>
    from tensorflow.contrib import bayesflow
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\__init__.py", line 24, in <module>
    from tensorflow.contrib.bayesflow.python.ops import entropy
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\entropy.py", line 23, in <module>
    from tensorflow.contrib.bayesflow.python.ops.entropy_impl import *
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\entropy_impl.py", line 30, in <module>
    from tensorflow.contrib.bayesflow.python.ops import variational_inference
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\variational_inference.py", line 26, in <module>
    from tensorflow.contrib.bayesflow.python.ops.variational_inference_impl import *
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\variational_inference_impl.py", line 29, in <module>
    from tensorflow.contrib.bayesflow.python.ops import stochastic_graph_impl as sg
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\stochastic_graph_impl.py", line 28, in <module>
    from tensorflow.contrib.bayesflow.python.ops import stochastic_tensor_impl
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\stochastic_tensor_impl.py", line 50, in <module>
    from tensorflow.contrib.bayesflow.python.ops import stochastic_gradient_estimators as sge
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\contrib\bayesflow\python\ops\stochastic_gradient_estimators.py", line 65, in <module>
    from tensorflow.python.training import training
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\python\training\training.py", line 118, in <module>
    from tensorflow.python.training.sync_replicas_optimizer import SyncReplicasOptimizer
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\python\training\sync_replicas_optimizer.py", line 31, in <module>
    from tensorflow.python.training import queue_runner
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\python\training\queue_runner.py", line 23, in <module>
    from tensorflow.python.training.queue_runner_impl import *
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\python\training\queue_runner_impl.py", line 25, in <module>
    from tensorflow.python.client import session
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\python\client\session.py", line 27, in <module>
    from tensorflow.core.protobuf import config_pb2
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\Pycharm\PyCharm Community Edition 2017.1.5\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "F:\python35\lib\site-packages\tensorflow\core\protobuf\config_pb2.py", line 30, in <module>
    dependencies=[tensorflow_dot_core_dot_framework_dot_cost__graph__pb2.DESCRIPTOR,tensorflow_dot_core_dot_framework_dot_graph__pb2.DESCRIPTOR,tensorflow_dot_core_dot_framework_dot_step__stats__pb2.DESCRIPTOR,tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DESCRIPTOR,tensorflow_dot_core_dot_protobuf_dot_cluster__pb2.DESCRIPTOR,tensorflow_dot_core_dot_protobuf_dot_rewriter__config__pb2.DESCRIPTOR,])
AttributeError: module 'tensorflow.core.framework.graph_pb2' has no attribute 'DESCRIPTOR'

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我决定全力以赴删除任何剩余的tensorflow文件和python,然后完全重新安装所有内容。工作就像一个魅力!