Tensorflow自定义对象检测API。运行model_main.py

时间:2019-07-17 17:17:01

标签: python tensorflow object-detection

我遵循了教程中提供的所有步骤。但是在执行model_main.py时会显示错误。

链接:https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

Traceback (most recent call last):
      File "model_main.py", line 109, in <module>
        tf.app.run()
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 40, in run
        _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
      File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 300, in run
        _run_main(main, args)
      File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 251, in _run_main
        sys.exit(main(argv))
      File "model_main.py", line 105, in main
        tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate
        return executor.run()
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
        return self.run_local()
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
        saving_listeners=saving_listeners)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
        loss = self._train_model(input_fn, hooks, saving_listeners)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model
        return self._train_model_default(input_fn, hooks, saving_listeners)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _train_model_default
        saving_listeners)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _train_with_estimator_spec
        _, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 754, in run
        run_metadata=run_metadata)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
        run_metadata=run_metadata)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1353, in run
        raise six.reraise(*original_exc_info)
      File "/usr/local/lib/python3.6/dist-packages/six.py", line 693, in reraise
        raise value
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
        return self._sess.run(*args, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1411, in run
        run_metadata=run_metadata)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1169, in run
        return self._sess.run(*args, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 950, in run
        run_metadata_ptr)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1173, in _run
        feed_dict_tensor, options, run_metadata)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1350, in _do_run
        run_metadata)
      File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1370, in _do_call
        raise type(e)(node_def, op, message)
    tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP]
         [[{{node case/cond/cond_jpeg/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert}}]]
         [[IteratorGetNext]]

0 个答案:

没有答案