无法训练tensorflow ssd\u mobilenet\u v2。无法获取匹配的文件

2024-04-25 07:12:27 发布

您现在位置:Python中文网/ 问答频道 /正文

在自定义数据集上成功地训练了faster_rcnn_inception_v2_coco_2018_01_28模型并获得了良好的结果之后,我尝试使用相同的数据集并遵循下面链接的相同教程使用ssd_mobilenet_v2_quantized_300x300_coco模型。我在尝试训练时遇到了这个错误。我仔细检查了所有使用的文件,并且在使用ssd_mobilenet_v1时也得到了完全相同的错误


    (tensorflow1) C:\tensorflow1\models\research\object_detection>python train.py --logtostderr -train_dir=C:/tensorflow1/models/research/object_detection/training --pipeline_config_path=C:/tensorflow1/models/research/object_detection/training/ssd_mobilenet_v2_quantized_300x300_coco.config
    C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\framework\dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_qint8 = np.dtype([("qint8", np.int8, 1)])
    C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\framework\dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
    C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_qint16 = np.dtype([("qint16", np.int16, 1)])
    C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
    C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      _np_qint32 = np.dtype([("qint32", np.int32, 1)])
    C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\framework\dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
      np_resource = np.dtype([("resource", np.ubyte, 1)])
    WARNING:tensorflow:From C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\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.
    WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\legacy\trainer.py:265: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
    Instructions for updating:
    Please switch to tf.train.create_global_step
    WARNING:tensorflow:num_readers has been reduced to 1 to match input file shards.
    WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\builders\dataset_builder.py:80: parallel_interleave (from tensorflow.contrib.data.python.ops.interleave_ops) is deprecated and will be removed in a future version.
    Instructions for updating:
    Use `tf.data.experimental.parallel_interleave(...)`.
    WARNING:tensorflow:From C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\ops\sparse_ops.py:1165: sparse_to_dense (from tensorflow.python.ops.sparse_ops) is deprecated and will be removed in a future version.
    Instructions for updating:
    Create a `tf.sparse.SparseTensor` and use `tf.sparse.to_dense` instead.
    WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\core\preprocessor.py:1208: calling squeeze (from tensorflow.python.ops.array_ops) with squeeze_dims is deprecated and will be removed in a future version.
    Instructions for updating:
    Use the `axis` argument instead
    WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\core\batcher.py:96: batch (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
    Instructions for updating:
    Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.batch(batch_size)` (or `padded_batch(...)` if `dynamic_pad=True`).
    WARNING:tensorflow:From C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\training\input.py:751: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
    Instructions for updating:
    To construct input pipelines, use the `tf.data` module.
    WARNING:tensorflow:From C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\training\input.py:751: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
    Instructions for updating:
    To construct input pipelines, use the `tf.data` module.
    INFO:tensorflow:depth of additional conv before box predictor: 0
    INFO:tensorflow:depth of additional conv before box predictor: 0
    INFO:tensorflow:depth of additional conv before box predictor: 0
    INFO:tensorflow:depth of additional conv before box predictor: 0
    INFO:tensorflow:depth of additional conv before box predictor: 0
    INFO:tensorflow:depth of additional conv before box predictor: 0
    Traceback (most recent call last):
      File "train.py", line 184, in <module>
        tf.app.run()
      File "C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
        _sys.exit(main(argv))
      File "C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\util\deprecation.py", line 306, in new_func
        return func(*args, **kwargs)
      File "train.py", line 180, in main
        graph_hook_fn=graph_rewriter_fn)
      File "C:\tensorflow1\models\research\object_detection\legacy\trainer.py", line 396, in train
        include_global_step=False))
      File "C:\tensorflow1\models\research\object_detection\utils\variables_helper.py", line 126, in get_variables_available_in_checkpoint
        ckpt_reader = tf.train.NewCheckpointReader(checkpoint_path)
      File "C:\Users\gregt_000\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 326, in NewCheckpointReader
        return CheckpointReader(compat.as_bytes(filepattern), status)
      File "C:\Users\gregt_000\Anaconda3\envs\tensorflow1\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.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on C:/tensorflow1/models/research/object_detection/ ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03/model.ckpt: Not found: FindFirstFile failed for: C:/tensorflow1/models/research/object_detection/ ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03 : The system cannot find the path specified.
    ; No such process

    (tensorflow1) C:\tensorflow1\models\research\object_detection>

https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

https://github.com/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi


Tags: ofinpyislibpackagestensorflowtype
1条回答
网友
1楼 · 发布于 2024-04-25 07:12:27

如果完全按照原样操作,则教程中有一个胭脂空白。这是导致错误的原因

第156行。将微调检查点更改为:“C:/tensorflow1/models/research/object\u detection/ssd\u mobilenet\u v2\u quantized\u 300x300\u coco\u 2019\u 01\u 03/model.ckpt”

相关问题 更多 >