【发布时间】:2018-05-30 04:19:58
【问题描述】:
调试后发现下面奇怪的错误
程序:(只有 1 行) 将张量流导入为 tf
当我第一次运行上面的代码时,我收到了以下警告:
\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py__init__.py:36: FutureWarning: issubdtype 的第二个参数从float 到np.floating 的转换已弃用。以后将被视为np.float64 == np.dtype(float).type。
从 ._conv 导入 register_converters 作为 _register_converters
=> 来自网络,这只是一个警告,可以忽略它(我猜)
当我重新运行相同的代码时,出现以下错误
文件“C:\Users\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py”,第 710 行,在运行文件中 execfile(文件名,命名空间)
文件“C:\Users\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py”,第 101 行,在 execfile exec(编译(f.read(),文件名,'exec'),命名空间)
文件“H:/Python/Test/Test.py”,第 15 行,在 将张量流导入为 tf
文件“C:\Users\AppData\Roaming\Python\Python36\site-packages\tensorflow__init__.py”,第 24 行,在 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
文件“C:\Users\AppData\Roaming\Python\Python36\site-packages\tensorflow\python__init__.py”,第 121 行,在 从 tensorflow.python.platform 导入测试
文件“C:\Users\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\platform\test.py”,第 65 行,在 tf_export('test.mock')(模拟)
调用中的文件“C:\Users\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\tf_export.py”,第 96 行 (undecorated_func.name, undecorated_func._tf_api_names))
SymbolAlreadyExposedError: 符号 unittest.mock 已公开为 ('test.mock',)。
现在我需要重新启动内核才能运行整个源代码。有什么想法吗?
谢谢
【问题讨论】:
标签: tensorflow import