如何解决当我使用gcloud和Tensorflow 1.15进行训练时,'模块'对象没有属性'contrib'错误
我已经在gcloud上开展了培训工作。云yaml文件指定了runtimeVersion = 1.15,所以我想Google VM上启动的tensorflow版本是1.15,对吗?训练任务因错误而终止,尽管这似乎与TF2有关。错误是:
...
File "/root/.local/lib/python2.7/site-packages/object_detection/model_lib.py",line 28,in <module>
from object_detection import exporter as exporter_lib
File "/root/.local/lib/python2.7/site-packages/object_detection/exporter.py",line 32,in <module>
slim = tf.contrib.slim
File "/usr/local/lib/python2.7/dist-packages/tensorflow_core/python/util/module_wrapper.py",line 193,in __getattr__
attr = getattr(self._tfmw_wrapped_module,name)
AttributeError: 'module' object has no attribute 'contrib'
(contrib模块已移出TF> = 2.0)。我说VM上的TF版本是不好的版本,对吗,如果是的话,如何指定较低的版本(如果配置yaml文件中没有runtimeVersion参数)?
编辑:我添加了与训练输入详细信息相对应的json,如AI平台仪表板上所示:
{
"scaleTier": "CUSTOM","masterType": "standard_gpu","workerType": "standard_gpu","parameterServerType": "standard","workerCount": "5","parameterServerCount": "3","packageUris": [
"gs://mybucket/detection/train/packages/object_detection-0.1.tar.gz","gs://mybucket/detection/train/packages/slim-0.1.tar.gz","gs://mybucket/detection/train/packages/pycocotools-2.0.tar.gz"
],"pythonModule": "object_detection.model_main","args": [
"--train_dir=gs://mybucket/detection/train","--pipeline_config_path=gs://mybucket/detection/data/faster_rcnn_resnet101_dumptruck.config"
],"region": "us-central1","runtimeVersion": "1.15","jobDir": "gs://mybucket/detection/train"
}
启动培训的命令是:
gcloud ai-platform jobs submit training ${JOB_ID} \
--job-dir=${OUTPUT_DIR} \
--region us-central1 \
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz,/tmp/pycocotools/pycocotools-2.0.tar.gz
--module-name object_detection.model_main \
--config object_detection/samples/cloud/cloud.yml \
-- \
--train_dir=${OUTPUT_DIR} \
--pipeline_config_path=${PIPELINE_CONFIG_PATH}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。