本文介绍了额外字符:TensorFlow HelloWorld 验证正确安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是为了确保这里从 tensorFlow hello-world 收到的结果是好的hello-world 页面

This is to make sure the result received from tensorFlow hello-world here is fineThe hello-world page

如果Python程序输出如下,则说明安装成功,可以开始编写TensorFlow程序了.(如果您不熟悉 TensorFlow,请参阅 TensorFlow 入门.)

>你好,TensorFlow!

实际发生的是接收输出:

What happens actually is to receive the output:

b'Hello, TensorFlow!'

特别是它里面有一个额外的b",这是不期望的.

In particular it has an extra ''b'' inside which is not expected.

推荐答案

b 不是字符串字符(不在引号内)而是前缀,表示字符串是一个字节包含 ASCII 字符的文字(与标准 python3 utf-8 编码相对).

The b is not a string character (it is not within the quotes) but a prefix, indicating that the string is a byte literal containing ASCII character (as opposed to the standard python3 utf-8 encoding).

另见这个问题.

这篇关于额外字符:TensorFlow HelloWorld 验证正确安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 07:52