TensorFlow:调用TensorFlow的IO函数时出现AttributeError;他们为什么失踪?

时间:2019-05-25 14:29:50

标签: python tensorflow import module

我在Python 3.5中使用TensorFlow 1.12.0。当我调用tf.io.decode_jpg()(或tf.io中的任何函数)时,出现以下错误:AttributeError: module 'tensorflow._api.v1.io' has no attribute 'decode_***'

我按如下所示导入TensorFlow:

import tensorflow as tf

我还尝试了直接导入io模块,但无济于事。我将函数调用如下:

rgb = tf.io.decode_image(tf.read_file(DIR_DATASET + sample_name + ".jpg"))

0 个答案:

没有答案