你如何在colaboratory上运行tensorflow?

时间:2018-07-12 17:28:58

标签: python-3.x tensorflow google-colaboratory

我正在尝试使用Google的协作实验室。输出的第一行充满希望。

Using TensorFlow backend.

但是随后我收到了此错误消息。

    ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

该错误显然触发了另一个错误。 (对于长堆栈跟踪很抱歉,但错误消息本身建议在寻求帮助时将其包括在内。)

    During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-6-0b846698ae4a> in <module>()
      2 import numpy as np
      3 import matplotlib.pylab as plt
----> 4 from keras.models import Sequential
      5 from keras.layers import Dense, InputLayer
      6 

/usr/local/lib/python3.6/dist-packages/keras/__init__.py in <module>()
      1 from __future__ import absolute_import
      2 
----> 3 from . import utils
      4 from . import activations
      5 from . import applications

/usr/local/lib/python3.6/dist-packages/keras/utils/__init__.py in <module>()
      4 from . import data_utils
      5 from . import io_utils
----> 6 from . import conv_utils
      7 
      8 # Globally-importable utils.

/usr/local/lib/python3.6/dist-packages/keras/utils/conv_utils.py in <module>()
      7 from six.moves import range
      8 import numpy as np
----> 9 from .. import backend as K
     10 
     11 

/usr/local/lib/python3.6/dist-packages/keras/backend/__init__.py in <module>()
     82 elif _BACKEND == 'tensorflow':
     83     sys.stderr.write('Using TensorFlow backend.\n')
---> 84     from .tensorflow_backend import *
     85 else:
     86     raise ValueError('Unknown backend: ' + str(_BACKEND))

/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in <module>()
      3 from __future__ import print_function
      4 
----> 5 import tensorflow as tf
      6 from tensorflow.python.training import moving_averages
      7 from tensorflow.python.ops import tensor_array_ops

/usr/local/lib/python3.6/dist-packages/tensorflow/__init__.py in <module>()
     22 
     23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
     25 # pylint: disable=wildcard-import
     26 from tensorflow.tools.api.generator.api import *  # pylint: disable=redefined-builtin

/usr/local/lib/python3.6/dist-packages/tensorflow/python/__init__.py in <module>()
     47 import numpy as np
     48 
---> 49 from tensorflow.python import pywrap_tensorflow
     50 
     51 # Protocol buffers

/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py in <module>()
     72 for some common reasons and solutions.  Include the entire stack trace
     73 above this error message when asking for help.""" % traceback.format_exc()
---> 74   raise ImportError(msg)
     75 
     76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

下面是咨询https://www.tensorflow.org/install/install_sources#common_installation_problems的建议。

但是该页面是关于从源代码安装TensorFlow的。我不是要从源代码安装。我只想要一个可以调用的可运行版本。

任何建议将不胜感激。

谢谢。

0 个答案:

没有答案