ChiShengChen / ResVMamba

The official repository implement of Res-VMamba: Fine-Grained Food Category Visual Classification Using Selective State Space Models with Deep Residual Learning
55 stars 3 forks source link

作者您好,为什么代码运行会提示断言错误。 #2

Closed 1802931263 closed 5 months ago

1802931263 commented 5 months ago

源代码中的断言是这样的, assert inputs[0].debugName().startswith("xs") # (B, D, L) assert inputs[1].debugName().startswith("dts") # (B, D, L) assert inputs[2].debugName().startswith("As") # (D, N) assert inputs[3].debugName().startswith("Bs") # (D, N) assert inputs[4].debugName().startswith("Cs") # (D, N) 但是输出的inputs确实这样的, input params: u.1 delta.1 A.1 B.1 C.1 D.1 delta_bias.1 从而导致程序运行终止。 错误提示: Traceback (most recent call last): File "main.py", line 407, in main(config) File "main.py", line 122, in main flops = model.flops() File "/root/autodl-tmp/ResVMamba/models/resvmamba.py", line 1118, in flops Gflops, unsupported = flop_count(model=model, inputs=(input,), supported_ops=supported_ops) File "/root/miniconda3/lib/python3.8/site-packages/fvcore/nn/flop_count.py", line 147, in flop_count for op, flop in flop_counter.by_operator().items(): File "/root/miniconda3/lib/python3.8/site-packages/fvcore/nn/jit_analysis.py", line 265, in by_operator stats = self._analyze() File "/root/miniconda3/lib/python3.8/site-packages/fvcore/nn/jit_analysis.py", line 584, in _analyze op_counts = self._op_handles[kind](inputs, outputs) File "/root/autodl-tmp/ResVMamba/models/resvmamba.py", line 348, in selective_scan_flop_jit assert inputs[0].debugName().startswith("xs") # (B, D, L) AssertionError

ChiShengChen commented 5 months ago

Hi @1802931263 , maybe is the problem of fvcore version, I have not meet that error

1802931263 commented 5 months ago

感谢您的回答,问题已经解决了!

syxkk commented 5 months ago

你好 请问你是如何解决的 我碰到了同样的问题