在终端中给出正确的路径以导入 tfrecord 文件

give the right path in terminal to import tfrecord file

我正在按照 deeplab 的指南在数据集 cityscapes 上训练提供的模型。

使用提供的bash文件(作为指南中的Step.1),我将原始数据转换为tfrecord的形式。

在指南的第 2 步中,我被要求提供数据集的路径作为终端标志 "dataset_dir":

python deeplab/train.py \ # ... some unrelevant flags
    --train_logdir=${PATH_TO_TRAIN_DIR} \
    --dataset_dir=${PATH_TO_DATASET}

指南的路径提示是“${PATH_TO_DATASET} 是 Cityscapes 数据集所在的目录。”

然而,

返回以下错误,说找不到这样的文件:

Traceback (most recent call last):
  File "deeplab/train.py", line 520, in <module>
    tf.app.run()
  File "/home/zwang/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/home/zwang/.local/lib/python3.6/site-packages/absl/app.py", line 299, in run
    _run_main(main, args)
  File "/home/zwang/.local/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "deeplab/train.py", line 470, in main
    dataset.get_one_shot_iterator(), dataset.num_of_classes,
  File "/home/zwang/workspace/models-master/research/deeplab/datasets/data_generator.py", line 320, in get_one_shot_iterator
    files = self._get_all_files()
  File "/home/zwang/workspace/models-master/research/deeplab/datasets/data_generator.py", line 347, in _get_all_files
    return tf.gfile.Glob(file_pattern)
  File "/home/zwang/.local/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 363, in get_matching_files
    return get_matching_files_v2(filename)
  File "/home/zwang/.local/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 384, in get_matching_files_v2
    compat.as_bytes(pattern))
tensorflow.python.framework.errors_impl.NotFoundError: /home/workspace/models-master/research/deeplab/datasets/cityscapes/.; No such file or directory

如何给出正确的路径以导入tfrecord文件?我的路径是否正确,或者错误可能出在其他地方?

原来那个家地址里少了我的用户名:

/home/USERNAME/workspace

而不是

/home/workspace