张量流中的 Python_io

moh*_*esh 6 python io tensorflow

我在使用 tensorflow 时遇到问题。我想使用TFRecordWriter()如下:

with tf.python_io.TFRecordWriter(testing_filename) as tfrecord_writer:
    # do sth
Run Code Online (Sandbox Code Playgroud)

但我收到错误:

AttributeError: 模块“tensorflow”没有属性“python_io”

我正在使用 tensorflow 1.2 和 python 3。

我该如何解决这个问题?

谢谢。

Tof*_*fiq 9

(python_io) 中的问题:

with tf.python_io.TFRecordWriter(testing_filename) as tfrecord_writer:
# do sth
Run Code Online (Sandbox Code Playgroud)

将其更改为:

with tf.io.TFRecordWriter(testing_filename) as tfrecord_writer:
# do sth 
Run Code Online (Sandbox Code Playgroud)