【发布时间】:2018-08-27 16:27:50
【问题描述】:
我是一名 ABAP 程序员,正在学习 tensorflow 对象检测 API,只是按照教程并使用来自 Dat Tran(https://github.com/datitran/raccoon_dataset) 的 Racoon 数据集。训练可以在我自己的 PC(python 3.6.3 和 tensorflow 1.5.0)上进行,但速度很慢。所以我把它放到了谷歌云平台上。工作一直失败。
训练输入如下所示。
"scaleTier": "CUSTOM",
"masterType": "standard_gpu",
"workerType": "standard_gpu",
"parameterServerType": "standard",
"workerCount": "9",
"parameterServerCount": "3",
"packageUris": [
"gs://racoon/train/packages/363569b954c446566b767aabfeb047adb0ed2f25f83248417e2667aac70d0790/object_detection-0.1.tar.gz",
"gs://racoon/train/packages/363569b954c446566b767aabfeb047adb0ed2f25f83248417e2667aac70d0790/slim-0.1.tar.gz"
],
"pythonModule": "object_detection.train",
"args": [
"--train_dir=gs://racoon/train",
"--pipeline_config_path=gs://racoon/data/ssd_mobilenet_v1_pets.config"
],
"region": "us-central1",
"runtimeVersion": "1.5",
"jobDir": "gs://racoon/train",
"pythonVersion": "3.5"
训练执行了近 100 步,但因错误而失败,作业日志显示如下。
The replica worker 1 exited with a non-zero status of 1.
Termination reason: Error.
Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 167, in <module> tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv))
File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir)
File "/root/.local/lib/python3.5/site-packages/object_detection/trainer.py", line 360, in train saver=saver)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 758, in train sys.maxint)) AttributeError: module 'sys' has no attribute 'maxint'
The replica worker 2 exited with a non-zero status of 1.
Termination reason: Error.
Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals)
File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 167, in <module> tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv))
File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir)
File "/root/.local/lib/python3.5/site-packages/object_detection/trainer.py", line 360, in train saver=saver)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 758, in train sys.maxint)) AttributeError: module 'sys' has no attribute 'maxint'
The replica worker 4 exited with a non-zero status of 1.
Termination reason: Error.
Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals)
File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 167, in <module> tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv))
File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir)
File "/root/.local/lib/python3.5/site-packages/object_detection/trainer.py", line 360, in train saver=saver)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 758, in train sys.maxint)) AttributeError: module 'sys' has no attribute 'maxint'
To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=1006195729918&resource=ml_job%2Fjob_id%2Fracoon_object_detection_9&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22racoon_object_detection_9%22
在本地 tensorflow 安装中,learning.py 确实有 sys.maxint,并且 IDE 显示语法错误。有没有人面临同样的问题并有解决方案?请与我们分享。 非常感谢。
【问题讨论】:
-
AFAI Caner 是对的,maxint 是 Python 3 的 sys 库已被移除。所以,请把它改成 sys.maxsize
标签: python-3.x tensorflow google-cloud-platform google-cloud-ml