如何在python控制台中传递数据路径?

时间:2018-12-30 19:15:38

标签: path arguments anaconda parameter-passing command-line-arguments

我需要传递参数data_path和数据集,我这样传递“ python no_train_hausdorff.py / datasets / Letter / LOW /字母”,但它无法读取数据集目录中可用的文件。 出现以下错误(train.cxl文件需要上传)

   Traceback (most recent call last):
      File "no_train_hausdorff.py", line 123, in <module>
        main()
      File "no_train_hausdorff.py", line 77, in main
    data_train, data_valid, data_test = datasets.load_data(args.dataset,      args.data_path, args.representation, args.normalization)
  File "D:\Python_practice\siamese_ged-master\datasets\load_data.py", line 22, in load_data
    return load_letters(data_path, representation, normalization)
  File "D:\Python_practice\siamese_ged-master\datasets\load_data.py", line 38, in load_letters
    data_train = datasets.Letters(data_path, 'train.cxl', representation, normalization)
  File "D:\Python_practice\siamese_ged-master\datasets\Letters.py", line 18, in __init__
    self.graphs, self.labels = getFileList(self.root + self.file_list)
  File "D:\Python_practice\siamese_ged-master\datasets\Letters.py", line 104, in getFileList
    tree = ET.parse(file_path)
  File "C:\Users\RoyalCom\Anaconda3\lib\xml\etree\ElementTree.py", line 1197, in parse
    tree.parse(source, parser)
  File "C:\Users\RoyalCom\Anaconda3\lib\xml\etree\ElementTree.py", line 587, in parse
       source = open(source, "rb")
   FileNotFoundError: [Errno 2] No such file or directory: '/datasets/Letter/LOW/train.cxl'

感谢期待

0 个答案:

没有答案