gpt4 book ai didi

python - Google ML Engine preprocessor_pb2 ImportError

转载 作者:行者123 更新时间:2023-11-30 09:47:52 27 4
gpt4 key购买 nike

我正在尝试通过 Google 的 ML Engine 进行训练。

我主要按照以下文章中的步骤来开发我的训练和测试集: https://towardsdatascience.com/build-a-taylor-swift-detector-with-the-tensorflow-object-detection-api-ml-engine-and-swift-82707f5b4a56

我不断遇到以下错误:

Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 49, in <module> from object_detection import trainer File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 27, in <module> from object_detection.builders import preprocessor_builder File "/root/.local/lib/python2.7/site-packages/object_detection/builders/preprocessor_builder.py", line 21, in <module> from object_detection.protos import preprocessor_pb2 ImportError: cannot import name preprocessor_pb2

我克隆并遵循了object_detection的安装步骤,包括protobuf编译和设置PYTHONPATH!示例model_builder_test.py从控制台也可以正常运行。

我的训练工作如下:

gcloud ml-engine jobs submit training my_training_job \
--job-dir=gs://myapp.appspot.com/train \
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz \
--module-name object_detection.train \
--region us-central1 \
--config object_detection/samples/cloud/cloud.yml \
-- \
--train_dir=gs://myapp.appspot.com/train \
--pipeline_config_path=gs://myapp.appspot.com/data/ssd_mobilenet_v1_coco.config

python -v在控制台中返回版本2.7

最佳答案

我想我通过将运行时版本更改为 1.2 解决了这个问题:

gcloud ml-engine jobs submit training my_training_job \
--runtime-version 1.2 \
--job-dir=gs://myapp.appspot.com/train \
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz \
--module-name object_detection.train \
--region us-central1 \
--config object_detection/samples/cloud/cloud.yml \
-- \
-- train_dir=gs://myapp.appspot.com/train \
-- pipeline_config_path=gs://myapp.appspot.com/data/ssd_mobilenet_v1_coco.config

我随后收到了有关缺少 matplotlib 的错误,并将以下行更改为

models/research/setup.py

REQUIRED_PACKAGES = ['Pillow>=1.0', 'matplotlib']

并重新运行:

python setup.py sdist
(cd slim && python setup.py sdist)

我迫不及待地希望 Google 发布更多工具来简化训练工作流程!

关于python - Google ML Engine preprocessor_pb2 ImportError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49965161/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com