在运行cifar10所遇到的问题
- AttributeError: module ‘tensorflow’ has no attribute ‘image_summary’

解决办法:将 tf.image_summary(‘images’, images) 更换为 tf.summary.image(‘images’, images),即可实现目标
In cifar10_input.py, a ValueError occurred stating that dimensions must be equal. However, the operation 'random_crop/GreaterEqual' encountered an error where the input shapes were found to be of dimensions 3 and 2.

只需将distorted_image = tf.image.random_crop(reshaped_image, [height, width])改为distorted_image = tf.image.random_crop(reshaped_image, [height, width, 3])则可
cifar_10_input.py : 在'tensorflow._api.v1.image'in模块中找不到'relu_activation函数'相关属性

解决方案:采用float_image = tf.image.per_image_standardization(distorted_image)即可实现对原始图像的标准化处理。
- AttributeError: module ‘tensorflow’ has no attribute ‘histogram_summary’

具体解决方案如下:通过替换 tf.histogram\_summary(tensor\_name + '\/activations', x) 为 tf.summary.histogram(tensor\_name + '\/activations', x) 即可实现该功能。
- AttributeError: module ‘tensorflow’ has no attribute ‘scalar_summary’

解决方案:更换为tf.summary.histogram(tensor_name + «/sparsity», tf.nn.zero_fraction(x))即可实现该指标的可视化分析。
*AttributeError: 该模块中找不到属性名为‘mul’的方法 解决方法:可以通过将tf.mul替换为tf.multiply来解决问题
错误信息:模块'tensorflow'中找不到属性'merge_all_summaries'。
建议修改代码中的函数调用:将代码中的tf.merge_all_summaries()替换为tf.summary.merge_all()。
- 错误信息:库‘tensorflow._api.v1.train’中没有属性‘SummaryWriter’。
解决方法:将tf.train.SummaryWriter() 替代为 tf.summary.FileWriter() 即可实现。
这些问题很可能与tensorflow的不同版本有关。
如果一时找不到对应的代码,请使用Ctrl+F来查找。
随后又遇到了另一个问题,并未找到有效的解决办法。
例如:
ValueError (see above for traceback): Obtained a label value of 255, which exceeds the permissible range of [0, 10).

怀疑是class_nums出现了问题吗?可是我已经确认过无误了呀…原本就是cifar10的数据集嘛,请问为何会出现label值达到255的情况呢?如果有懂的朋友麻烦告知一下吧…
