字符串常量的打印总是附加“b”inTensorF

2024-05-19 07:08:10 发布

您现在位置:Python中文网/ 问答频道 /正文

在Windows 10上对TensorFlow r0.12(CPU)进行测试时,我发现打印出来的字符串contant最后总是带有一个“b”。python的打印是正常的。我想不出为什么来这里寻求帮助。代码如下:

>>>import tensorflow as tf
>>>hello = tf.constant('Hello, TensorFlow!')
>>>sess = tf.Session()
>>>print(sess.run(hello))
b'Hello, TensorFlow!'

Tags: 字符串代码importhellosessionwindowstftensorflow

热门问题