Closed DomineeringDragon closed 2 years ago
Hi @DomineeringDragon ,
You can use the below code after defining the model
:
from ptflops import get_model_complexity_info
with torch.cuda.device(0):
macs, params = get_model_complexity_info(model.cuda(), (101, 17, 3), as_strings=True, print_per_layer_stat=True)
print('{:<30} {:<8}'.format('Computational complexity: ', macs))
print('{:<30} {:<8}'.format('Number of parameters: ', params))
Noted that FLOPs will be relevant to the input shape, e.g., (101, 17, 3) here. You need to modify it if you use different datasets.
我是一个大四的准研究生,也是这个方向的新手,十分感谢你,这对我很有用!
If there is no further question, I will close this issue. Please feel free to reopen this if you still need help. :)
相比于MSE、MAE等数据,我还想比较这个模型和其他TSF模型的不同,比如FLOPS和params。请问有办法获得SCINet的这些信息吗?