当前位置:网站首页>pytorch统计模型的参数个数
pytorch统计模型的参数个数
2022-06-13 08:51:00 【刀么克瑟拉莫】
- 就是遍历每一个参数,把大小加起来
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
paras=torch.load('weights.pth', map_location=device)
count = 0
for k2 in paras:
l = list(paras[k2].size())
temporary = 1
for i in l:
temporary *= i
count += temporary
print(count)
边栏推荐
- ERP outlet
- Taobao commodity historical price interface / commodity historical price trend interface code docking and sharing
- 15. copy constructor
- Differences and uses among cookies, localstorage, sessionstorage, and application caching
- 网络安全漏洞分析之重定向漏洞分析
- 1.初步认识express
- JS - array de duplication in the array object case
- JS string method
- Browser render passes
- redis. exceptions. ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.
猜你喜欢

DIY无人机(匿名拓控者P2+F330机架)

Installing pytorch under Anaconda

Uni app subcontracting loading and optimization

Invalid flex layout setting width

Mapbox usage, including drawing, loading, modifying, deleting points and faces, displaying pop ups, etc

1.SolidWorks各模块的学习顺序

Print an array clockwise

ADT Google browser plug-in ad Terminator

JS - for cycle case: Horse grain

關於RSA加密解密原理
随机推荐
Margin:0 reason why auto does not take effect
0. some doubts about learning SolidWorks for the first time
Is it safe to open an account online? Can a novice open an account?
Cesium achieves sunny, rainy, foggy, snowy and other effects
Print an array clockwise
0. Quelques doutes au sujet de SolidWorks
【安全】零基础如何从0到1逆袭成为安全工程师
Namespace in TS (2)
JS - max. of array cases
The 360 mobile assistant on Huawei maimang 7 cannot be uninstalled
useRoutes() may be used only in the context of a <Router> component.
MySQL 8.0 modifying SQL_ mode=only_ full_ group_ by
Browser render passes
What is the difference between getfullyear() and getyear()
【Pycharm踩坑记录】配置远程运行后提示,[Errno 2] No such file or directory
How does jupyter notebook directly output the values of multiple variables after running?
redis
WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
Mobile terminal development I: basic concepts
Screenshot of cesium implementation scenario