import os.path
import logging
import time
from collections import OrderedDict
import torch
from utils import utils_logger
from utils import utils_image as util
'''
This code can help you to calculate:
`FLOPs`, `#Params`, `Runtime`, `#Activations`, `#Conv2d`, and `Max Memory Allocated`.
For more information, please refer to ECCVW paper "AIM 2020 Challenge on Efficient Super-Resolution: Methods and Results".
# If you use this code, please consider the following citations:
@inproceedings{zhang2020aim,
title={AIM 2020 Challenge on Efficient Super-Resolution: Methods and Results},
author={Kai Zhang and Martin Danelljan and Yawei Li and Radu Timofte and others},
booktitle={European Conference on Computer Vision Workshops},
year={2020}
}
@inproceedings{zhang2019aim,
title={AIM 2019 Challenge on Constrained Super-Resolution: Methods and Results},
author={Kai Zhang and Shuhang Gu and Radu Timofte a
测试flop runningtime,paras等代码
最新推荐文章于 2024-03-13 22:42:20 发布
这段代码主要展示了如何利用PyTorch计算模型的效率指标,包括FLOPs、参数数量、运行时间和最大内存分配。它涉及到两个模型:MSRResNet和IMDN,并提供了相应的模型加载和输入尺寸设置。代码还包含了计算激活次数和卷积层数的功能,以及记录运行时间。此外,还提供了计算GPU内存使用情况的选项。

最低0.47元/天 解锁文章
1115

被折叠的 条评论
为什么被折叠?



