![](/img/trans.png)
[英]Error when evaluating pretrained model in Tensorflow object-detection (tensorflow.python.framework.errors_impl.NotFoundError:)
[英]Tensorflow / object_detection / training / model_main.py / tensorflow.python.framework.errors_impl.NotFoundError:
根据Github的说明( https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_locally.md ),我准备了TFRecord文件,标签映射文件,管道配置文件和推荐的目录结构写在页面上。 然后,我在Windows10和Anaconda3(64bit)提示符下运行以下命令。
python model_main.py --pipeline_config_path='training1\\models\\model\\ssd_inception_v2_pets1.config' --model_dir='training1\\models\\model' --num_train_steps=50000 --sample_1_of_n_eval_examples=1 --logtostderr
在这里,我从原始的“ ssd_inception_v2_pets.config”修改了“ ssd_inception_v2_pets1.config”。
错误消息如下。
Traceback (most recent call last):
File "model_main.py", line 109, in <module>
tf.app.run()
File "C:\Users\Anaconda3\envs\obj-detect\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "model_main.py", line 71, in main
FLAGS.sample_1_of_n_eval_on_train_examples))
File "C:\Users\Tensorflow_model_master\models-master\models-master\research\object_detection\model_lib.py", line 566, in create_estimator_and_inputs
config_override=config_override)
File "C:\Users\Tensorflow_model_master\models-master\models-master\research\object_detection\utils\config_util.py", line 95, in get_configs_from_pipeline_file
proto_str = f.read()
File "C:\Users\Anaconda3\envs\obj-detect\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 125, in read
self._preread_check()
File "C:\Users\Anaconda3\envs\obj-detect\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 85, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "C:\Users\Anaconda3\envs\obj-detect\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: 'training1\\models\\model\\ssd_inception_v2_pets1.config' : \udc8ew\udc92肳\udc82ꂽ\udc83p\udc83X\udc82\udcaa\udc8c\udca9\udc82\udca9\udc82\udce8\udc82܂\udcb9\udc82\udcf1\udc81B
; No such process
最后的错误消息是“ \\ udc8ew〜”。.您能帮我解决此错误吗?
我已经检查了其他人的讨论,并且在几乎所有情况下,命令行中目录树中的反斜杠( \\
)混淆都可能导致错误。 我认为我的表达是正确的。
我猜另一种可能性是ssd_inception_v2_pets1.config中的错字。 我在文件中写了如下文件地址。 我不确定是否应该添加'r'(行表达式),选择单引号(')还是双引号(“),然后选择反斜杠( \\
)或双反斜杠( \\\\
)。
train_input_reader: {
tf_record_input_reader {
input_path: r'C:\Users\Tensorflow_model_master\models-master\models-master\research\object_detection\training1\data\train.record'
}
label_map_path: r'C:\Users\Tensorflow_model_master\models-master\models-master\research\object_detection\training1\data\label_map.pbtxt'
}
eval_input_reader: {
tf_record_input_reader {
input_path: r'C:\Users\Tensorflow_model_master\models-master\models-master\research\object_detection\training1\data\test.record'
}
label_map_path: r'C:\Users\Tensorflow_model_master\models-master\models-master\research\object_detection\training1\data\label_map.pbtxt'
shuffle: false
num_readers: 1
}
在我看来,这仍然是路径错误。 为了节省麻烦,我建议您尝试使用配置文件的绝对路径,例如--pipeline_config_path='C:\\\\Users\\\\Tensorflow_model_master\\\\blabla ...'
该命令也应该从“ research”目录运行。 python object_detection\\model_main.py --pipeline_config_path='C:\\\\Users\\\\Tensorflow_model_master\\\\models-master\\\\models-master\\\\research\\\\object_detection\\\\training1\\\\models\\\\model\\\\ssd_inception_v2_pets1.config' --model_dir='C:\\\\Users\\\\Tensorflow_model_master\\\\models-master\\\\models-master\\\\research\\\\object_detection\\\\training1\\\\models\\\\model' --num_train_steps=50000 --sample_1_of_n_eval_examples=1 --logtostderr
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.