解决AttributeError: ‘Namespace‘ object has no attribute ‘arch‘

简介: 解决AttributeError: ‘Namespace‘ object has no attribute ‘arch‘

问题描述

在运行ACmix-ResNet模型时出现问题

Traceback (most recent call last):
  File "E:/Code/PyCharm/Paddle/main.py", line 504, in <module>
    main()
  File "E:/Code/PyCharm/Paddle/main.py", line 116, in main
    main_worker(args.gpu, ngpus_per_node, args)
  File "E:/Code/PyCharm/Paddle/main.py", line 260, in main_worker
    'arch': args.arch,
AttributeError: 'Namespace' object has no attribute 'arch'

原因分析:

很简单的一个错误,没有添加参数

解决方案:

使用parser添加相应参数即可

parser.add_argument('--arch', default=1, type=float, metavar='M',
                    help='arch')


目录
相关文章
|
7月前
|
TensorFlow 算法框架/工具 Python
【Tensorflow 2】解决'Tensor' object has no attribute 'numpy'
解决'Tensor' object has no attribute 'numpy'
158 3
|
8月前
|
并行计算 Serverless API
函数计算操作报错合集之出现 "AttributeError: 'NoneType' object has no attribute 'pop'" 错误,是什么原因
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。
248 1
|
7月前
|
API C++ Python
【Azure 应用服务】Python fastapi Function在Azure中遇见AttributeError异常(AttributeError: 'AsgiMiddleware' object has no attribute 'handle_async')
【Azure 应用服务】Python fastapi Function在Azure中遇见AttributeError异常(AttributeError: 'AsgiMiddleware' object has no attribute 'handle_async')
|
7月前
|
TensorFlow API 算法框架/工具
【Tensorflow+keras】解决使用model.load_weights时报错 ‘str‘ object has no attribute ‘decode‘
python 3.6,Tensorflow 2.0,在使用Tensorflow 的keras API,加载权重模型时,报错’str’ object has no attribute ‘decode’
109 0
|
8月前
|
Python
【Python】已解决:(Python xlwt写入Excel报错)AttributeError: ‘function’ object has no attribute ‘font’
【Python】已解决:(Python xlwt写入Excel报错)AttributeError: ‘function’ object has no attribute ‘font’
182 0
|
8月前
|
Python
【Python】已解决:(Python写入Excel表格报错)‘NoneType’ object has no attribute ‘write’
【Python】已解决:(Python写入Excel表格报错)‘NoneType’ object has no attribute ‘write’
457 0
|
8月前
|
XML 数据格式 Python
【Python】已解决:AttributeError: ‘function’ object has no attribute ‘ELement’
【Python】已解决:AttributeError: ‘function’ object has no attribute ‘ELement’
300 0
|
8月前
|
API Python
【Python】已解决:AttributeError: ‘TfidfVectorizer’ object has no attribute ‘get_feature_names_out’
【Python】已解决:AttributeError: ‘TfidfVectorizer’ object has no attribute ‘get_feature_names_out’
293 0
|
7天前
|
Java
课时78:Object类的基本概念
Object类的主要特点是可以解决参数的统一问题,使用object类可以接受所有的数据类型。 1. Object类简介 2. 观察Object类接收所有子类对象 3. 使用Object类接收数组
|
3月前
|
JSON Java Apache
Java基础-常用API-Object类
继承是面向对象编程的重要特性,允许从已有类派生新类。Java采用单继承机制,默认所有类继承自Object类。Object类提供了多个常用方法,如`clone()`用于复制对象,`equals()`判断对象是否相等,`hashCode()`计算哈希码,`toString()`返回对象的字符串表示,`wait()`、`notify()`和`notifyAll()`用于线程同步,`finalize()`在对象被垃圾回收时调用。掌握这些方法有助于更好地理解和使用Java中的对象行为。