tensorflow 训练cifar10报错

1、AttributeError: ‘module‘ object has noattribute ‘random_crop‘

解决方案:

将distorted_image= tf.image.random_crop(reshaped_image, [height, width])改为:

distorted_image = tf.random_crop(reshaped_image,[height, width,3])

2、AttributeError: ‘module’ object has no attribute’per_image_whitening’

‘per_image_whitening 改为:’per_image_standardization

3、‘module‘ object has no attribute ‘image_summary‘ ---->Please switch to tf.summary.image

4、AttributeError: ‘module‘ object has no attribute ‘histogram_summary‘

AttributeError: ‘module‘ object has no attribute ‘histogram_summary‘

>> histogram_summary 改为:tf.summary.histogram

5、AttributeError: ‘module‘ object has no attribute ‘scalar_summary‘

AttributeError: ‘module‘ object has no attribute ‘scalar_summary‘

>> tf.scalar_summary 改为:tf.summary.scalar

6、AttributeError: ‘module‘ object has no attribute ‘mul‘

According to the tensorflow 1.0.0 release notes,

tf.mul, tf.sub and tf.neg are deprecated in favor of tf.multiply, tf.subtract and tf.negative.

7、raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (2, 128, 1) and () are incompatible

时间: 2024-10-29 03:40:20

tensorflow 训练cifar10报错的相关文章

Tensorflow运行程序报错 FailedPreconditionError

1 FailedPreconditionError错误现象 在运行tensorflow时出现报错,报错语句如下: FailedPreconditionError (see above for traceback): Attempting to use uninitialized value Variable [[Node: Variable/read = _MklIdentity[T=DT_FLOAT, _kernel="MklOp", _device="/job:local

新安装完 tensorflow 后import tensorflow as tf 报错

>>> import tensorflow as tf /opt/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 =

PyCharm导入tensorflow包报错的问题

[注]PyCharm导入tensorflow包报错的问题 若是你也遇到这个问题,说明你也没有理解tensorflow到底在哪里. 当安装了anaconda3.6后,在PyCharm中设置interpreter,这个解释器决定了你在PyCharm环境中写的代码采用什么方式去执行. 若是你的设置是anaconda下的python.exe.就会发现在PyCharm中写入import tensorflow as tf 时,就会报错,提示没有tensorflow模块,这是因为anaconda文件下的pyt

报错解决——Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

在导入tensorflow后,进行运算时,出现了报错Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 解决方法:在最顶行写入以下代码即可 import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' 参考资料:Advanced Vector Extensions import os os.environ["TF_CPP_M

Windows下安装Tensorflow报错 “DLL load failed:找不到指定的模块"

Windows下安装完tensorflow后,在cmd下运行python后import tensorflow出现如下错误: Traceback (most recent call last): File "D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_

tensorflow读取jpg格式图片报错 ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images

当运行mpimg.imread("img.jpg")时,spyder 出现如下错误: ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images 解决办法就是  安装pillow即可 我是在anaconde里安装的很简单,执行如下步骤即可: tensorflow读取jpg格式图片报错 ValueError: Only kn

Tensorflow报错:InvalidArgumentError: You must feed a value for placeholder tensor 'input_y' with dtype

此错误神奇之处是每次第一次运行不会报错,第二次.第三次第四次....就都报错了.关掉重启,又不报错了,运行完再运行一次立马报错!搞笑! 折磨了我半天,终于被我给解决了! 问题解决来源于这边博客:https://blog.csdn.net/m0_37870649/article/details/79428960 我的解决方法:在fit模型的代码前面加入一行代码:tf.reset_default_graph() 如下图: 我原本是猜想自定义TextCNN模型的代码中出了问题,但其实这个错误和dtyp

import tensorflow 报错: tf.estimator package not installed.

import tensorflow 报错: tf.estimator package not installed. 解决方案1: 安装 pip install tensorflow-estimator==1.10.12 解决方案2: downgrade pandas from 0.23.4 to 0.23.0 upgrade matplotlib to 3.0.0 原文地址:https://www.cnblogs.com/sddai/p/10538807.html

单机多GPU训练报错

问题一: 在keras中使用多个GPU训练模型时,出现错误 AttributeError: '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string' , 根据错误提示是'_TfDeviceCaptureOp'对象没有属性'_set_device_from_string'. 解决措施:经过思考,我觉得我的tensorflow版本可能有问题,所以将tensorflow从1.14.0版本降到1.12.0版本,此问题得到