首页 > 解决方案 > 我在笔记本中将 tensorflow 作为 tf 导入并成功运行,但是当我使用 tf.__version__ 时,它显示 NameError: name 'tf' is not defined。帮我

问题描述

图片在这里第一个块运行没有任何错误。但第二个说名称错误 tf 未定义,即使我已将 tensorflow 导入为 tf.

标签: pythontensorflowvirtualvirtual-environment

解决方案


在这种情况下,我建议将 tensorflow 回滚到以前的稳定版本。这可能是当前版本的错误。


推荐阅读