首页 > 解决方案 > from __future__ import absolute_import as _absolute_import 错误,tensorflow 不起作用

问题描述

我正在使用 spyder 中的 tensorflow 进行深度学习,但我是新手。突然 tensorflow 停止工作,现在import tensorflow as tf行给出以下错误:

from __future__ import absolute_import as _absolute_import
       ^
SyntaxError: invalid syntax

我的其他工作项目也不再有效。我搜索了错误,但找不到有用的解决方案。

标签: python-3.xtensorflowspyder

解决方案


这是导入模块的正确语法,from __future__ import absolute_import但由于您没有输入错误的完整细节,这可能是 python 版本的问题,因为TensorFlow目前支持直到Python3.8. 细节


推荐阅读