Closed ShenZheng2000 closed 2 years ago
We use the code like the following one.
import thop
from thop import clever_format, profile
print(clever_format(profile(model.netG, (None,torch.randn(1,4,400,600).cuda(),torch.randn(1,192,50,75).cuda(), 0 ,True))),"%.5")
More specifically, you can add the aforementioned code to a suitable place of the file "test.py"/"test_unpaired.py", .e.g., after the definition of the model.
Thanks for your explanation. After model.netG = model.netG.cuda()
, I made a slight change based on the code you gave, and now it works.
print(clever_format(profile(model.netG, (None,torch.randn(1,6,400,600).cuda(),torch.randn(1,192,50,75).cuda(), 0 ,True))),"%.5")
Hello, authors! I am using the following function to calculate the FLOPs, #Params, and the inference time, and this function works for methods like ZeroDCE, RUAS, and URetinexNet.
However, if I pass you
model
as the variable, it gives me the following error.I have spent a lot of time trying to understand the code in your
models
folder, but it is to complicated for me to understand. Therefore, I hope you can clarify how I can calculate the FLOPs and #Params for your model. Thanks!