D:\pythonProject1\cnn.py:47: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations s=np.int(num_example*ratio) Traceback (most recent call last): File "D:\pythonProject1\cnn.py", line 55, in <module> x=tf.placeholder(tf.float32,shape=[None,w,h,c],name='x') AttributeError: module 'tensorflow' has no attribute 'placeholder'
时间: 2024-04-22 18:27:09 浏览: 99
解决 warning 显示 The linear_assignment function is deprecated in 0.21 and will be removed from 0.23. Us…
这个错误提示看起来像是使用了过时的语法,导致 tensorflow 模块无法使用。您可以尝试更新您的 Tensorflow 版本,或者修改代码中的语法。例如,将 `tf.placeholder` 改为 `tf.compat.v1.placeholder`。同时,也可以尝试使用 `tf.compat.v1.disable_v2_behavior()` 来切换到旧版本的语法。
阅读全文