gpt4 book ai didi

Tensorflow: TypeError: __new__() 有一个意外的关键字参数 'file'

转载 作者:行者123 更新时间:2023-12-02 02:57:24 25 4
gpt4 key购买 nike

我正在尝试运行此处看到的宠物探测器谷歌云示例:https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_pets.md ,并完成大部分工作,直到我真正尝试运行训练,直到我运行命令:

gcloud ml-engine jobs submit training `whoami`_object_detection_`date +%s` \
--runtime-version 1.2 \
--job-dir=gs://test-run-2/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://test-run-2/train \
--pipeline_config_path=gs://test-run-2/data/pipeline.config

这不可避免地会导致错误:

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
File "/root/.local/lib/python2.7/site-packages/object_detection/protos/preprocessor_pb2.py", line 71, in <module>
options=None, file=DESCRIPTOR),
TypeError: __new__() got an unexpected keyword argument 'file'

我不确定我到底做错了什么或者错误来自哪里,因为我在 preprocessor_pb2.py 文件中看不到。任何帮助将不胜感激!

最佳答案

我在将 tensorflow 升级到 1.11 版本后遇到了这个问题,并通过运行解决了它: pip install --upgrade protobuf

关于Tensorflow: TypeError: __new__() 有一个意外的关键字参数 'file',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48546508/

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