python - python:add_argument用于读取数据集但无法读取数据文件夹
问题描述
我是 python 新手,在这里我正在练习通过调试来理解代码。
python: add_argument 用于读取数据集但无法读取数据文件夹。
请检查附件和下面的代码。
ap = argparse.ArgumentParser()
## This is a useful line because it adds an option that we are interested in. The input file
ap.add_argument("-d", "--dataset", required=True,
help="path to input dataset")
## The plot
ap.add_argument("-p", "--plot", type=str, default="plot.png",
help="path to output loss/accuracy plot")
## The model
ap.add_argument("-m", "--model", type=str,
default="mask_detector.model",
help="path to output kite detector model")
## Parse the command line argument
args = vars(ap.parse_args())
得到错误:
kite_detector.py: error: the following arguments are required: -d/--dataset
但是文件夹名称dataset的数据已经存在于多个分类文件夹所在的项目文件夹中。
[![在此处输入图像描述][2]][2]
解决方案
推荐阅读
- php - 可以使用正则表达式进行 PSR-7 验证吗?(参数冲突)
- excel - 从另一个表单 vba Excel 更新组合框
- websphere - IBM MQ 连接失败
- git - Git - 交互式变基后无法推送
- c# - 如何在 Jenkins 中获取非硬编码项目路径并在 Jenkins 管道脚本中提及路径
- python - 将 matplotlib 表的列子集右/左对齐
- django - 在 Django 中通过基于函数的视图更新帖子
- javascript - 禁止经过身份验证的用户访问 nuxt js 中的登录页面
- php - 将带有键的 PHP 变量传递给 Bootstrap 模式
- jms - WebSphere Liberty:中间上下文不存在:jms/