Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用CUDA GeForce9600GT在Ubuntu服务器上执行python-tensorflow_Python_Ubuntu_Cuda_Tensorflow - Fatal编程技术网

使用CUDA GeForce9600GT在Ubuntu服务器上执行python-tensorflow

使用CUDA GeForce9600GT在Ubuntu服务器上执行python-tensorflow,python,ubuntu,cuda,tensorflow,Python,Ubuntu,Cuda,Tensorflow,我刚刚在我的mac上通过了。本教程激发了我对NN的热情,因此我设置了一个Ubuntu服务器,以便进行大规模培训 但是,我无法在服务器上运行cifar10\u train.py。我总是遇到这样的错误: tensorflow源代码的路径: ~/python/tensorflow/tensorflow/tensorflow/ tensorflow virtualenv安装路径: ~/tensorflow/ Cmd: source ~/tensorflow/bin/activate #activat

我刚刚在我的mac上通过了。本教程激发了我对NN的热情,因此我设置了一个Ubuntu服务器,以便进行大规模培训

但是,我无法在服务器上运行cifar10\u train.py。我总是遇到这样的错误:

tensorflow源代码的路径:

~/python/tensorflow/tensorflow/tensorflow/
tensorflow virtualenv安装路径:

~/tensorflow/
Cmd:

source ~/tensorflow/bin/activate #activate virtualenv
python/tensorflow/tensorflow/tensorflow/models/image/cifar10/cifar10_train.py #the raw source code of tensorflow is in ~/python/tensorflow/tensorflow/tensorflow
Traceback (most recent call last):
  File "python/tensorflow/tensorflow/tensorflow/models/image/cifar10/cifar10_train.py", line 28, in <module>
    import tensorflow.python.platform
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 22, in <module>
    from tensorflow.python.client.client_lib import *
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/client_lib.py", line 35, in <module>
    from tensorflow.python.client.session import InteractiveSession
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 11, in <module>
    from tensorflow.python import pywrap_tensorflow as tf_session
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
错误:

source ~/tensorflow/bin/activate #activate virtualenv
python/tensorflow/tensorflow/tensorflow/models/image/cifar10/cifar10_train.py #the raw source code of tensorflow is in ~/python/tensorflow/tensorflow/tensorflow
Traceback (most recent call last):
  File "python/tensorflow/tensorflow/tensorflow/models/image/cifar10/cifar10_train.py", line 28, in <module>
    import tensorflow.python.platform
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 22, in <module>
    from tensorflow.python.client.client_lib import *
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/client_lib.py", line 35, in <module>
    from tensorflow.python.client.session import InteractiveSession
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 11, in <module>
    from tensorflow.python import pywrap_tensorflow as tf_session
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
我仍然遇到一个错误,但它已缩短为以下内容:

Traceback (most recent call last):
File "cifar10_train.py", line 28, in <module>
import tensorflow.python.platform
ImportError: No module named tensorflow.python.platform
回溯(最近一次呼叫最后一次):
文件“cifar10_train.py”,第28行,在
导入tensorflow.python.platform
ImportError:没有名为tensorflow.python.platform的模块
更新2根据某人的建议,我通过pip安装protobuf。由于某种奇怪的原因,错误再次发生变化:

Traceback (most recent call last):
  File "cifar10_train.py", line 28, in <module>
    import tensorflow.python.platform
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 13, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 16, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/core/framework/tensor_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
  File "/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/core/framework/tensor_shape_pb2.py", line 22, in <module>
    serialized_pb=_b('\n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow\"d\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02 \x03(\x0b\x32 .tensorflow.TensorShapeProto.Dim\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tb\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'syntax'
回溯(最近一次呼叫最后一次):
文件“cifar10_train.py”,第28行,在
导入tensorflow.python.platform
文件“/home/it13095/tensorflow/local/lib/python2.7/site-packages/tensorflow/_-init__.py”,第4行,在
从tensorflow.python导入*
文件“/home/it13095/tensorflow/local/lib/python2.7/site packages/tensorflow/python/_init__.py”,第13行,在
从tensorflow.core.framework.graph_pb2导入*
文件“/home/it13095/tensorflow/local/lib/python2.7/site packages/tensorflow/core/framework/graph_pb2.py”,第16行,在
从tensorflow.core.framework导入属性值pb2作为tensorflow\u dot\u core\u dot\u framework\u dot\u属性值pb2
文件“/home/it13095/tensorflow/local/lib/python2.7/site packages/tensorflow/core/framework/attr_value_pb2.py”,第16行
从tensorflow.core.framework将tensor_pb2导入为tensorflow_dot_core_dot_framework_dot_tensor_pb2
文件“/home/it13095/tensorflow/local/lib/python2.7/site packages/tensorflow/core/framework/tensor_pb2.py”,第16行,在
从tensorflow.core.framework导入tensor_shape_pb2作为tensorflow_dot_core_dot_framework_dot_tensor_shape_pb2
文件“/home/it13095/tensorflow/local/lib/python2.7/site packages/tensorflow/core/framework/tensor\u shape\u pb2.py”,第22行
序列化的\u pb=\u b('\n,tensorflow/core/framework/tensor\u shape.proto\x12\ntensorflow\'d\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02\x03(\x0b\x32.tensorflow.TensorShapeProto.Dim\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01
TypeError:\uuuu init\uuuuuuuuu()获取了意外的关键字参数“syntax”

TensorFlow目前需要CUDA toolkit 7.0和cuDNN

cuDNN需要cc 3.0 GPU,CUDA toolkit 7.0需要cc 2.0 GPU

您的9600GT不满足以下要求:

为了使用GPU支持构建或运行TensorFlow,需要安装NVIDIA的Cuda Toolkit 7.0和CUDNN 6.5 V2

TensorFlow GPU支持需要具有NVidia计算能力>=3.5的GPU卡

因此,如果您想使用支持GPU的TensorFlow,您将需要cc3.5或更高版本的GPU,并按照步骤正确安装所需的支持软件。或者,您可以在不支持GPU的情况下安装TensorFlow