【TensorFlow报错】AttributeError: module 'tensorflow._api.v1.image' has no attribute 'per_image_whitenin

报错提示:

cifar10_input.py : AttributeError: module 'tensorflow._api.v1.image' has no attribute 'per_image_whitening'

报错原因:Tensorflow版本冲突,没有per_image_whitening方法

解决方案:执行如下修改

# 报错代码
float_image = tf.image.per_image_whitening(distorted_image)

# 改正代码
float_image = tf.image.per_image_standardization(distorted_image)

你可能感兴趣的:(Python报错排坑)