使用tensorflow导入LSTM模型时导入错误



我已经开始涉足ML/DL,我正在尝试使用以下代码导入LSTM模型:

from tensorflow.keras.layers import LSTM

然而,我得到以下回溯错误,不确定如何继续。

C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39python.exe C:/Users/Ahmed_Abdelmuniem/PycharmProjects/pythonProject/main.py
2021-08-19 10:42:59.820385: 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-08-19 10:42:59.821236: 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.
Traceback (most recent call last):
File "C:UsersAhmed_AbdelmuniemPycharmProjectspythonProjectmain.py", line 1, in <module>
from tensorflow.keras.layers import LSTM
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow__init__.py", line 55, in <module>
from ._api.v2 import compat
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compat__init__.py", line 39, in <module>
from . import v1
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compatv1__init__.py", line 34, in <module>
from . import compat
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compatv1compat__init__.py", line 39, in <module>
from . import v1
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compatv1compatv1__init__.py", line 36, in <module>
from tensorflow._api.v2.compat.v1 import data
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compatv1data__init__.py", line 13, in <module>
from . import experimental
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compatv1dataexperimental__init__.py", line 86, in <module>
from . import service
File "C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflow_apiv2compatv1dataexperimentalservice__init__.py", line 363, in <module>
from tensorflow.python.data.experimental.ops.data_service_ops import ShardingPolicy
ImportError: cannot import name 'ShardingPolicy' from 'tensorflow.python.data.experimental.ops.data_service_ops' (C:UsersAhmed_AbdelmuniemAppDataLocalProgramsPythonPython39libsite-packagestensorflowpythondataexperimentalopsdata_service_ops.py)
Process finished with exit code 1

我相信这是不需要说的,但我对tensorflow非常陌生,而且仍然是python的初学者。

好吧,解决方案是重新安装管理员权限,因为似乎某些部分没有正确安装,因为没有管理员权限pip没有编辑某些文件夹的权利。

相关内容

  • 没有找到相关文章

最新更新