Skip to content

flops打印不出来 #9430

@2315455002

Description

@2315455002

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

Traceback (most recent call last):
File "/home/ljw/PaddleDetection/tools/train.py", line 212, in
main()
File "/home/ljw/PaddleDetection/tools/train.py", line 208, in main
run(FLAGS, cfg)
File "/home/ljw/PaddleDetection/tools/train.py", line 161, in run
trainer.train(FLAGS.eval)
File "/home/ljw/PaddleDetection/ppdet/engine/trainer.py", line 538, in train
self._flops(flops_loader)
File "/home/ljw/PaddleDetection/ppdet/engine/trainer.py", line 1345, in _flops
flops = flops(self.model, input_spec) / (1000**3)
File "/home/ljw/anaconda3/envs/paddle1/lib/python3.10/site-packages/paddleslim/analysis/flops.py", line 138, in dygraph_flops
program = dygraph2program(model, inputs, dtypes=dtypes)
File "/home/ljw/anaconda3/envs/paddle1/lib/python3.10/site-packages/paddleslim/core/dygraph.py", line 99, in dygraph2program
return _dy2prog(layer, inputs, dtypes)
File "/home/ljw/anaconda3/envs/paddle1/lib/python3.10/site-packages/paddleslim/core/dygraph.py", line 110, in _dy2prog
program), paddle.base.dygraph.base.to_static_mode_guard(
AttributeError: module 'paddle.base.dygraph.base' has no attribute 'to_static_mode_guard'. Did you mean: 'to_static_mode_guard'?

复现环境 Environment

paddlepaddle-gpu 3.0.0
paddleslim 2.6.0

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

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions