为什么tensorflow不能连接到hdfs?

x0fgdtte  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(526)

我想把hdfs和tensorflow连接起来,但是不行。我调试到tensorflow代码时发现如下错误:

(Pdb) s
--Return--
> /usr/local/python3/lib/python3.5/site-packages/tensorflow/python/util/compat.py(60)as_bytes()->b'hdfs://user...c/mnist_logs3'
-> return bytes_or_text.encode(encoding)
(Pdb) l
55  
56     Raises:
57       TypeError: If `bytes_or_text` is not a binary or unicode string.
58     """
59     if isinstance(bytes_or_text, _six.text_type):
60  ->     return bytes_or_text.encode(encoding)
61     elif isinstance(bytes_or_text, bytes):
62       return bytes_or_text
63     else:
64       raise TypeError('Expected binary or unicode string, got %r' %
65                       (bytes_or_text,))
(Pdb) s
loadFileSystems error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
hdfsBuilderConnect(forceNewInstance=0, nn=user, port=0, kerbTicketCachePath=(NULL), userName=(NULL)) error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
> /usr/local/python3/lib/python3.5/site-packages/tensorflow/python/lib/io/file_io.py(395)is_directory()
-> pywrap_tensorflow.TF_DeleteStatus(status)
(Pdb)

有人能帮我吗?谢谢!

7y4bm7vi

7y4bm7vi1#

我最好的猜测是它无法加载适当的库。仔细检查机器上是否安装了hadoop,并适当地设置环境变量。请参见此处的说明:https://www.tensorflow.org/deploy/hadoop

相关问题