训练时 config_util.py 拒绝 Tensorflow 访问

Tensorflow access denied in config_util.py while training

我在 tensorflow 中训练模型时遇到问题。我正在研究 Windows 10。当我 运行 命令时:

python ./object_detection/model_main.py --pipeline_config_path=C:/Tensorflow/object-detection/ssd_mobilenet_v1_coco_2018_01_28 --model_dir=C:/Tensorflow/object-detection/output-model --num_train_steps=50000 --sample_1_of_n_eval_examples=1 --alsologtostderr

C:/Tensorflow/models/research 开始训练过程 我在 config_util.py 脚本的第 95 (proto_str = f.read()) 行收到错误。以下 你可以看到我的整个控制台输出:

Traceback (most recent call last):
  File "./object_detection/model_main.py", line 109, in <module>
    tf.app.run()
  File "C:\Users\lucci\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
    _sys.exit(main(argv))
  File "./object_detection/model_main.py", line 71, in main
    FLAGS.sample_1_of_n_eval_on_train_examples))
  File "C:\Tensorflow\models\research\object_detection\model_lib.py", line 536, in create_estimator_and_inputs
    config_override=config_override)
  File "C:\Tensorflow\models\research\object_detection\utils\config_util.py", line 95, in get_configs_from_pipeline_file
    proto_str = f.read()
  File "C:\Users\lucci\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 125, in read
    self._preread_check()
  File "C:\Users\lucci\AppData\Local\Programs\Python\Python36\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\lucci\AppData\Local\Programs\Python\Python36\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.UnknownError: NewRandomAccessFile failed to Create/Open: C:/Tensorflow/object-detection/ssd_mobilenet_v1_coco_2018_01_28 : Zugriff verweigert
; Input/output error

错误在最后两行:Zugriff verweigert 是德语,意思是 access denied
我是这台电脑的管理员(这是我自己的电脑),我对文件夹有完全控制权(我用 PowerShell 仔细检查过)。当我尝试将文件夹移动到另一个文件夹时 地方,例如C:\Users\lucci\Documents\ 我得到同样的错误。当我 运行 控制台作为管理员,当我尝试命令 runas /user:lucci ... 和 等等。

谁能帮我解决这个问题? 我正在使用 Python3.6.

编辑: 这也无济于事:Tensorflow Windows Accessing Folders Denied:"NewRandomAccessFile failed to Create/Open: Access is denied. ; Input/output error"

我终于自己找到了解决方案。无论您是在 Linux 还是 Windows 上操作都没有关系。 当您使用 运行 命令时,您总是必须指定 pipeline.config 文件的完整路径。 因此,当您的 pipeline.config 文件位于 C:/ObjectDetection/Model/pipeline.config 时,它不是 足以指定 C:/ObjectDetection/ 之类的位置。您必须指定位置 作为 C:/ObjectDetection/pipeline.config.

运行 命令再次使用 完整路径 参数 --pipeline_config_file 效果很好!!!