input_queue = tf.train.slice_input_producer([image, label])
运行的时候报错:
module 'tensorflow_core._api.v2.train' has no attribute 'slice_input_producer'
解决方案
使用input_queue = tf.data.Dataset.from_tensor_slices([image, label])
代替 input_queue = tf.train.slice_input_producer([image, label])
如果改完后还报错: Can't convert non-rectangular Python sequence to Tensor
解决方案:
input_queue = tf.data.Dataset.from_tensor_slices([image, label])
改为 tf.data.Dataset.from_tensor_slices((image, label))