Skip to content

tool/model/analyze_model.py 分析flops文件问题 #3398

@maoyj2333

Description

@maoyj2333

问题确认 Search before asking

Bug描述 Describe the Bug

在运行tool/model/analyze_model.py出现错误:
AttributeError: 'Config' object has no attribute 'model'

tool/model/analyze_model.py源码中并没有根据model_cfg实例化出一个具体的model,而在'_dynamic_flops'函数中,
代码不断调用model.train(),'model.eval()'等函数

复现环境 Environment

platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.31
Python: 3.9.0 (default, Nov 15 2020, 14:28:56) [GCC 7.3.0]
Paddle compiled with cuda: False
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PaddleSeg: 2.8.0
PaddlePaddle: 2.4.2
OpenCV: 4.5.5

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!

Metadata

Metadata

Labels

Code PR is neededThis issue could inspire a code PRbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions