google colab上的python train.py不久后停止,仅输出一个检查点

时间:2018-12-29 11:34:18

标签: python google-colaboratory

我是物体检测的新手,我正尝试使用ssd_mobilenet_v1_pets在Google colab上训练模型,并将其重新配置为服装数据集。 我正在尝试运行休闲命令:

get_ipython().system_raw('python object_detection/legacy/train.py \
    --logtostderr \
    --pipeline_config_path=adrive/data/ssd_mobilenet_v1_pets.config \
    --train_dir=train/')

然后我只进入火车目录中的1个检查点文件,然后训练停止。

  train/
      checkpoint
      events.out.tfevents.1546080063.8e30af98992d
      graph.pbtxt
      model.ckpt-0.data-00000-of-00001
      model.ckpt-0.index
      model.ckpt-0.meta
      pipeline.config

我尝试使用休闲命令而不是train.py:

!python object_detection/model_main.py \
    --checkpoint_dir=content/models/research/model_dir/model_ssd/ \
    --pipeline_config_path=adrive/data/ssd_mobilenet_v1_pets.config \
    --model_dir= train_data  \
    --alsologtostderr \
    --num_train_steps=3000 \
    --num_eval_steps=500

但我仍然收到错误提示:

The backend was *originally* set to 'module://ipykernel.pylab.backend_inline' by the following code:
  File "object_detection/model_main.py", line 26, in <module>
    from object_detection import model_lib
  File "/content/models/research/object_detection/model_lib.py", line 27, in <module>
    from object_detection import eval_util
  File "/content/models/research/object_detection/eval_util.py", line 27, in <module>
    from object_detection.metrics import coco_evaluation
  File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 20, in <module>
    from object_detection.metrics import coco_tools
  File "/content/models/research/object_detection/metrics/coco_tools.py", line 47, in <module>
    from pycocotools import coco
  File "/content/models/research/pycocotools/coco.py", line 49, in <module>
    import matplotlib.pyplot as plt
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 72, in <module>
    from matplotlib.backends import pylab_setup
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 14, in <module>
    line for line in traceback.format_stack()


  import matplotlib; matplotlib.use('Agg')  # pylint: disable=multiple-statements
Traceback (most recent call last):
  File "object_detection/model_main.py", line 109, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "object_detection/model_main.py", line 62, in main
    config = tf.estimator.RunConfig(model_dir=FLAGS.model_dir)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/run_config.py", line 504, in __init__
    compat_internal.path_to_str(model_dir))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/run_config.py", line 899, in _get_model_dir
    raise ValueError('model_dir should be non-empty.')
ValueError: model_dir should be non-empty.

这是我休耕的https://github.com/mosheliv/tfcollab2

的链接

我想训练和测试我的模型

0 个答案:

没有答案