import tensorflow
2021-12-16 00:56:51.153666: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-12-16 00:56:51.153973: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
D:\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py:21: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged.
module = self._system_import(name, *args, **kwargs)
Traceback (most recent call last):
File "", line 1, in <module>
File "D:\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\ASUS\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "D:\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
.....
File "D:\PyCharm
File "C:\Users\ASUS\AppData\Roaming\Python\Python37\site-packages\keras_preprocessing\image\affine_transformations.py", line 13, in <module>
import scipy
File "D:\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "E:\2020\game\venv\Lib\site-packages\scipy\__init__.py", line 136, in <module>
from . import _distributor_init
File "D:\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "E:\2020\game\venv\Lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。
兼容问题,tensorflow 2.7是64位的,python也选用了64位的,但是某个包(这里是scipy,位于另一个虚拟环境E:\2020\game\venv\中,是之前项目安装的32位包,但由于各种原因,在当前的64位虚拟环境中导入scipy时指向了它,导致版本不匹配)
直接去把E:\2020\game\venv\Lib\site-packages\里面的scipy删掉