[英]I cannot test installation of the Tensorflow Object Detection API in Google Colab
I'm just starting to learn how to use the ML models in the Tensorflow Object Detection API on Google Colab and so I'm trying to follow the documentation very carefully.我刚刚开始学习如何在 Google Colab 上的 Tensorflow 对象检测 API 中使用 ML 模型,因此我正在尝试非常仔细地遵循文档。 After installing the libraries and packages, I'm testing the installation using the command from https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html :
安装库和包后,我正在使用https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html中的命令测试安装:
python object_detection/builders/model_builder_tf2_test.py
But I get the following error:但我收到以下错误:
Traceback (most recent call last):
File "object_detection/builders/model_builder_tf2_test.py", line 24, in <module>
from object_detection.builders import model_builder
File "/usr/local/lib/python3.7/dist-packages/object_detection/builders/model_builder.py", line 37, in <module>
from object_detection.meta_architectures import deepmac_meta_arch
File "/usr/local/lib/python3.7/dist-packages/object_detection/meta_architectures/deepmac_meta_arch.py", line 20, in <module>
from object_detection.models.keras_models import resnet_v1
File "/usr/local/lib/python3.7/dist-packages/object_detection/models/keras_models/resnet_v1.py", line 28, in <module>
from keras.applications import resnet # pylint:disable=g-import-not-at-top
File "/usr/local/lib/python3.7/dist-packages/keras/__init__.py", line 25, in <module>
from keras import models
File "/usr/local/lib/python3.7/dist-packages/keras/models.py", line 20, in <module>
from keras import metrics as metrics_module
File "/usr/local/lib/python3.7/dist-packages/keras/metrics.py", line 27, in <module>
from keras import activations
File "/usr/local/lib/python3.7/dist-packages/keras/activations.py", line 20, in <module>
from keras.layers import advanced_activations
File "/usr/local/lib/python3.7/dist-packages/keras/layers/__init__.py", line 93, in <module>
from keras.layers.core import Masking
File "/usr/local/lib/python3.7/dist-packages/keras/layers/core/__init__.py", line 20, in <module>
from keras.layers.core.dropout import Dropout
File "/usr/local/lib/python3.7/dist-packages/keras/layers/core/dropout.py", line 26, in <module>
class Dropout(base_layer.BaseRandomLayer):
AttributeError: module 'keras.engine.base_layer' has no attribute 'BaseRandomLayer'
Even after importing keras version 2.0, it still not working, what I can do to solve this issue, thanks即使在导入 keras 2.0 版后,它仍然无法正常工作,我可以做些什么来解决这个问题,谢谢
Solved it: tensorflow version 2.5.0 is not compatible with the code provided.解决了:tensorflow 2.5.0 版本与提供的代码不兼容。 I had to install 2.8.0 so that it will work
我必须安装 2.8.0 才能正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.