我运行了命令:
python3 research/object_detection/legacy/train.py \
--logtostderr \
--train_dir = training/ \
--pipeline_config_path = training/ssd_mobilenet_v1_pets.config
但我收到此错误:
WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
* https://github.com/tensorflow/addons
If you depend on functionality not listed there, please file an issue.
WARNING:tensorflow:From /home/apoorva/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py:125: main (from __main__) is deprecated and will be removed in a future version.
Instructions for updating:
Use object_detection/model_main.py.
Traceback (most recent call last):
File "research/object_detection/legacy/train.py", line 184, in <module>
tf.app.run()
File "/home/apoorva/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/home/apoorva/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "research/object_detection/legacy/train.py", line 93, in main
FLAGS.pipeline_config_path)
File "/home/apoorva/Tensorflowapi/models-master/research/slim/object_detection/utils/config_util.py", line 97, in get_configs_from_pipeline_file
proto_str = f.read()
File "/home/apoorva/.local/lib/python3.5/site-packages/tensorflow/python/lib/io/file_io.py", line 132, in read
pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
File "/home/apoorva/.local/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: =; Is a directory
我在train.py
中运行了models/research/object_detection/legacy
,遇到了相同的错误,因此尝试运行model_main.py
的更高版本的train.py
,但仍然无法解决问题。 / p>
python3 research/object_detection/legacy/train.py \
--logtostderr \
--train_dir = training/ \
--pipeline_config_path = training/ssd_mobilenet_v1_pets.config
我希望培训能够开始并显示每一步的损失和准确性,但是命令没有运行。
答案 0 :(得分:0)
您以错误的格式调用命令。
python3 research/object_detection/legacy/train.py \
--logtostderr --train_dir=training/ \
--pipeline_config_path=training/ssd_mobilenet_v1_pets.config
--train_dir
与=
和training
之间不应有空格。否则,=
将被解释为参数的值。另外,建议使用model_main.py
,因此正确的呼叫方式是:
python3 object_detection/model_main.py --alsologtostderr \
--model_dir=training/\
--pipeline_config_path=training/ssd_mobilenet_v1_pets.config