先看错误代码:

parser.add_argument('--cfg', type=str, required=True, metavar="FILE", help='path to config file', )

–cfg 是定义为可选参数;required=True,表示必须在命令行输入

解决方案:

将required=True
改为required=False

error: the following arguments are required: --cfg相关推荐

  1. (理解和3种方法完全解决pycharm报错)main.py: error: the following arguments are required: -d/--dataset

    文章目录 背景 理解 完全解决 方法1 方法2 方法3 背景 很多人只说解决方案,却不说原因,遂有此篇. 在pycharm中直接运行如下代码main.py报错: import argparse if ...

  2. error: the following arguments are required: cfg_file

    error: the following arguments are required: cfg_file 这里一共列举4种情况: 1)参数前面没有加-- 2)参数没有加default值 3)没有这个 ...

  3. python3 运行argparse XX.py: error: the following arguments are required: N An exception has occurred,

    Spyder(python 3.6) 运行含argparse模块的程序 # max sum.py import argparseparser = argparse.ArgumentParser(des ...

  4. error: the following arguments are required: img, config, checkpoint

    目录 01问题描述 02 问题分析 ​03 解决方案 01问题描述 在验证mmdetection环境是否安装成功的时候,出现如下错误: error: the following arguments a ...

  5. main.py: error: the following arguments are required:

    报错 "main.py: error: the following arguments are required:" 1.首先查看报错信息 如图下图所示 main.py: erro ...

  6. error: the following arguments are required

    [1]usage: run_one_image.py [-h] [--use_cuda] [--use_cython]                         image_path templ ...

  7. “ error: the following arguments are required: --model, --data“解决办法

    "error: the following arguments are required: --model, --data"解决办法 问题描述 解决办法 问题描述 pycharm运 ...

  8. train.py: error: the following arguments are required: --config解决办法

    train.py: error: the following arguments are required: --config解决办法 最近在跑github上的深度学习开源项目,在导入项目运行trai ...

  9. CentOS 6.5 安装 Redis 执行 make #error Newer version of jemalloc required

    为什么80%的码农都做不了架构师?>>>    CentOS 6.5 安装 Redis 执行 make #error "Newer version of jemalloc ...

最新文章

  1. pacman安装php的位置,PacMan 01——地图的搭建
  2. 浅析工业级物联网项目的快速开发
  3. html背景自动换,html页面换皮肤颜色、背景图片(更换页面背景,常驻缓存)刷新保存...
  4. 关于计算机 硬件方方面的整理
  5. 使用FizzBu​​zz和JUnitParams进行单元测试
  6. httpd 处理模型
  7. 揭秘“清华园”的“N”种打开方式!
  8. 装饰器模式(Decorator Pattern)
  9. 分布式一致性算法-paxos详解与分析
  10. mongodb 学习第二天,基本操作
  11. Kubernetes生态系统与演进路线
  12. 水下无线光通信关键技术与未来展望
  13. 软考中级软件设计师---下午题
  14. WindowsServer实训项目——第一章:安装与激活WindowsServer
  15. Redis中key-value对value的数据类型
  16. 信息系统分析与设计 第十章 系统总体设计
  17. java中Graphics类的使用
  18. PMP知识点总结—质量功能展开(QFD)
  19. 正则匹配中文英文字符及标点
  20. Android面试Hash原理详解二

热门文章

  1. 【 uC/OS II 】uC/OS II 源代码阅读(os_mbox.c)消息邮箱
  2. 人体红外线感应垃圾桶控制板自动感应垃圾桶线路板MCU单片机开发
  3. 【UE】制作简单的山脉地形
  4. 织梦dedecms 创建栏目
  5. 工具类_公历农历互转_同时支持星期的查询
  6. 内网渗透笔记——:)一个笑脸
  7. win7怎样打开位置定位服务器,Win7系统如何打开系统服务?Win7系统打开系统服务的方法...
  8. 关于spi的半双工读写和全双工读写的一些理解
  9. 保险丝有哪些分类它的工作原理是什么?
  10. html 上下广告悬浮,JS上下自动漂浮广告,可关闭