下载 Tensorflow 对象检测时出错

问题描述 投票:0回答:1

错误:

AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental'

当我试图验证是否正确下载了张量流对象检测时,发生了这种情况。

这是我用于验证过程的代码:

VERIFICATION_SCRIPT = os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection', 'builders', 'model_builder_tf2_test.py')
# Verify Installation
!python {VERIFICATION_SCRIPT}

pip list shows me this:

absl-py                       1.4.0
asttokens                     2.4.1
astunparse                    1.6.3
bleach                        6.1.0
cachetools                    5.3.3
certifi                       2024.2.2
charset-normalizer            3.3.2
click                         8.1.7
colorama                      0.4.6
comm                          0.2.2
contourpy                     1.2.1
cycler                        0.12.1
Cython                        0.29.37
debugpy                       1.8.1
decorator                     5.1.1
dm-tree                       0.1.8
etils                         1.8.0
executing                     2.0.1
flatbuffers                   24.3.25
fonttools                     4.50.0
fsspec                        2024.3.1
gast                          0.5.4
gin-config                    0.5.0
google-api-core               2.18.0
google-api-python-client      2.124.0
google-auth                   2.29.0
google-auth-httplib2          0.2.0
google-pasta                  0.2.0
googleapis-common-protos      1.63.0
grpcio                        1.62.1
h5py                          3.10.0
httplib2                      0.22.0
idna                          3.6
importlib_resources           6.4.0
ipykernel                     6.29.4
ipython                       8.23.0
jedi                          0.19.1
joblib                        1.3.2
jupyter_client                8.6.1
jupyter_core                  5.7.2
kaggle                        1.6.8
keras                         3.1.1
kiwisolver                    1.4.5
libclang                      18.1.1
lxml                          5.2.1
Markdown                      3.6
markdown-it-py                3.0.0
MarkupSafe                    2.1.5
matplotlib                    3.8.3
matplotlib-inline             0.1.6
mdurl                         0.1.2
ml-dtypes                     0.3.2
namex                         0.0.7
nest-asyncio                  1.6.0
numpy                         1.26.4
oauth2client                  4.1.3
opencv-python                 4.9.0.80
opencv-python-headless        4.9.0.80
opt-einsum                    3.3.0
optree                        0.11.0
packaging                     24.0
pandas                        2.2.1
parso                         0.8.3
pillow                        10.3.0
pip                           24.0
platformdirs                  4.2.0
portalocker                   2.8.2
promise                       2.3
prompt-toolkit                3.0.43
proto-plus                    1.23.0
protobuf                      3.20.3
psutil                        5.9.8
pure-eval                     0.2.2
py-cpuinfo                    9.0.0
pyasn1                        0.6.0
pyasn1_modules                0.4.0
pycocotools                   2.0.7
Pygments                      2.17.2
pyparsing                     3.1.2
python-dateutil               2.9.0.post0
python-slugify                8.0.4
pytz                          2024.1
pywin32                       306
PyYAML                        5.4.1
pyzmq                         25.1.2
regex                         2023.12.25
requests                      2.31.0
rich                          13.7.1
rsa                           4.9
sacrebleu                     2.4.1
scikit-learn                  1.4.1.post1
scipy                         1.13.0
sentencepiece                 0.2.0
seqeval                       1.2.2
setuptools                    65.5.0
six                           1.16.0
stack-data                    0.6.3
tabulate                      0.9.0
tensorboard                   2.16.2
tensorboard-data-server       0.7.2
tensorflow                    2.16.1
tensorflow-addons             0.22.0
tensorflow-datasets           4.9.4
tensorflow-hub                0.16.1
tensorflow-intel              2.16.1
tensorflow-io-gcs-filesystem  0.31.0
tensorflow-metadata           1.14.0
tensorflow-model-optimization 0.8.0
termcolor                     2.4.0
text-unidecode                1.3
tf_keras                      2.16.0
tf-models-official            2.5.1
tf-slim                       1.1.0
threadpoolctl                 3.4.0
toml                          0.10.2
tornado                       6.4
tqdm                          4.66.2
traitlets                     5.14.2
typeguard                     2.13.3
typing_extensions             4.10.0
tzdata                        2024.1
uritemplate                   4.1.1
urllib3                       2.2.1
wcwidth                       0.2.13
webencodings                  0.5.1
Werkzeug                      3.0.2
wget                          3.2
wheel                         0.43.0
wrapt                         1.16.0
zipp                          3.18.1
python keras jupyter-notebook tensorflow2.0 tf.keras
1个回答
2
投票

TensorFlow 版本与您尝试验证的对象检测模型所需的版本不匹配。 您可以尝试以下一些方法:

  1. 更新张量流

    pip install --升级张量流

  2. 验证您尝试安装的型号的兼容性并安装正确版本的tensorflow

© www.soinside.com 2019 - 2024. All rights reserved.