首页 > 解决方案 > AttributeError:模块'tensorflow'没有tensorflow 1.3版的属性'random'

问题描述

我正在使用 tensorflow 版本 1.3.0 Cuda 版本 8 和 cuDNN 版本 6

当我运行时,python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"我看到以下错误:-

Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'random'

请帮助我,因为我已经坚持了很长一段时间。

标签: pythonpython-3.xtensorflow

解决方案


升级你的 tensorflow 版本

pip install --upgrade tensorflow

另外,检查这个 StackOverflow 问题


推荐阅读