lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

计算量和参数量

todesti2 opened this issue · comments

我已经阅读过所有有关的issues和文档说明,但还是跑不出来
请问有人跑出来了吗,能给我一个指令吗?
这是我的指令和结果

`(paddlepaddle) root@autodl-container-6b1911bd52-d696bc56:~/RT-DETR/rtdetr_paddle# python flops.py

WARNING: OMP_NUM_THREADS set to 12, not 1. The computation speed will not be optimized if you use data parallel. It will fail if this PaddlePaddle binary is compiled with OpenBlas since OpenBlas does not support multi-threads.
PLEASE USE OMP_NUM_THREADS WISELY.
W1201 09:06:51.720057 1005 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.7, Runtime API Version: 11.2
W1201 09:06:51.723688 1005 gpu_resources.cc:149] device: 0, cuDNN Version: 8.1.
Traceback (most recent call last):
File "flops.py", line 14, in
paddle.flops(model, None, blob, custom_ops=None, print_detail=False)
TypeError: flops() got multiple values for argument 'custom_ops'`

#72

您好,这并没有解决我的问题。可以i麻烦您仔细看下我上面的问题嘛?我已经被这个困扰四个多月了一直没有头绪

我这边按照流程操作没问题的 另外我看其他同学也跑出来了, 你这边应该是文档里第一步没改对

我这边按照流程操作没问题的 另外我看其他同学也跑出来了, 你这边应该是文档里第一步没改对

我想得到的是:
我对RT-DETR添加tricks后训练出来的模型 的参数量和计算量

步骤:
用第一步的代码替换对应文件中的flops函数。【只替换,其他什么都没改】
接着创建文件get.py,放入第二步的代码并执行【只改将config改成绝对路径】

问题:
Traceback (most recent call last): File "get.py", line 14, in <module> paddle.flops(model, None, blob, custom_ops=None, print_detail=False) TypeError: flops() got multiple values for argument 'custom_ops'

不管尝试多少次都是这个问题,困扰太久实在没有法子了,只能来求助您……请帮助我❤

第一步怎么替换的 替换之后的文件upload看下

第一步怎么替换的 替换之后的文件upload看下

感谢您的回复,我是完整替换了里面原有的def flops()函数
image

紧接着创建get.py,将第二部分代码放进去并将cfg_path改成绝对路径
image

通过 python get.py
就出现报错:
Traceback (most recent call last):
File "get.py", line 14, in paddle.flops(model, None, blob, custom_ops=None, print_detail=False)
TypeError: flops() got multiple values for argument 'custom_ops'

  1. 你在flops函数里随便加一行 比如在30行 + print('xxx') ;看看走这个函数了嘛
  2. get.py不需要放到hapi下面 在你工作目录随便找个地方放
  1. 你在flops函数里随便加一行 比如在30行 + print('xxx') ;看看走这个函数了嘛
  2. get.py不需要放到hapi下面 在你工作目录随便找个地方放

image

已经按照您说的做了,但是很震惊的是不管是否缩进,都没有经过这个函数!! image

  1. 确认下你用的是那个python以及对应的paddle安装位置 (一般paddle在对应python环境的site-packages下)
which python
  1. 确认下你用的是那个python以及对应的paddle安装位置 (一般paddle在对应python环境的site-packages下)
which python

天呐,原来是在这里!!!刚改掉成功输出了!!!我宣布你是我最喜爱的作者没有之一5555
我四个月的困扰终于解决了!!!
感谢感谢!!❤❤太厉害了向你学习!!
image

在你这环境下吧 image

在你这环境下吧 image

是的,我深刻认识到了这个问题!泪的教训!!爱你作者!!!