当前位置:网站首页>mmedicting的get_flops.py的使用
mmedicting的get_flops.py的使用
2022-08-08 03:07:00 【农民小飞侠】
今天试了一下mmediting的一些功能,由于我的机器上没有gpu,照着文章来复现也碰见了一些问题,我这里把这些问题记录一下,分享出来,
其中ge t_flops.py我做了一点就修改。
model = build_model(
cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg).cuda
变成了:
model = build_model(
cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
然后运行:
python tools/get_flops.py configs/restorers/srresnet_srgan/srgan_x4c64b16_g1_1000k_div2k.py --shape 40 40
输出为:
00k_div2k.py --shape 40 40
2022-08-07 11:12:35,210 - mmedit - INFO - load checkpoint from torchvision path: torchvision://vgg19
Downloading: "https://download.pytorch.org/models/vgg19-dcbb9e9d.pth" to /home/infname112/.cache/torch/hub/checkpoints/vgg19-dcbb9e9d.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 548M/548M [00:32<00:00, 17.9MB/s]
SRGAN(
16.017 M, 100.000% Params, 4.068 GFLOPs, 100.000% FLOPs,
(generator): MSRResNet(
1.518 M, 9.475% Params, 4.068 GFLOPs, 100.000% FLOPs,
(conv_first): Conv2d(0.002 M, 0.011% Params, 0.003 GFLOPs, 0.070% FLOPs, 3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(trunk_net): Sequential(
1.182 M, 7.378% Params, 1.892 GFLOPs, 46.513% FLOPs,
(0): ResidualBlockNoBN(
0.074 M, 0.461% Params, 0.118 GFLOPs, 2.907% FLOPs,
(conv1): Conv2d(0.037 M, 0.231% Params, 0.059 GFLOPs, 1.452% FLOPs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(conv2): Conv2d(0.037 M, 0.231% Params, 0.059 GFLOPs, 1.452% FLOPs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(relu): ReLU(0.0 M, 0.000% Params, 0.0 GFLOPs, 0.003% FLOPs, inplace=True)
.......
官方给的用法是:
python tools/get_flops.py configs/resotorer/srresnet.py --shape 40 40
所以照葫芦画瓢写了一个。
参考文献
边栏推荐
猜你喜欢

PC Museum (Fanwai 01)-Chenghuiwan, junior high school students develop a large-scale navigation game with physical scales

devops学习(十一) 构建主分支--触发器--钉钉通知

The project management process and key points for each link

Negative Number Storage and Type Conversion in Program

程序中的负数存储及类型转换

Build a personal network disk using z-file and Qiniu cloud object storage

DolpinScheduler

【建议收藏】百分百全套中高级Android面试题

LeetCode Binary Tree Series - All Paths of 257 Binary Trees

KDD'22 | CausalMTA: Unbiased Advertising Multi-Touch Attribution Technology Based on Causal Inference
随机推荐
Nanny level tutorial!Golang microservices simple architecture in practice
Build a personal network disk using z-file and Qiniu cloud object storage
LeetCode二叉树系列——144.左叶子之和
PAT甲级 1055 The World‘s Richest
Task Scheduling Framework Quartz Read the article
任务调度框架 Quartz 一文读懂
The ORACLE database connection exception after restart
【我的日志】关于我可爱的新同事
C#《原CSharp》第四回 人常见岁月更替 却难知人文相继
prometheus学习1部署了解
【My Diary】About my lovely new colleague
期货公司有各种的开户手续费
The sock MySQL start failure caused by lock file
JS 怎么使用十六进制保存100位状态的问题
高效记忆法
云原生(三十三) | Kubernetes篇之平台存储系统部署
The difference between orElse and orElseGet in Optional
巧记硬链接与软链接
解决Endnote插入参考文献时导致word闪退问题
Solve the problem of word flashback when Endnote inserts references