当前位置:网站首页>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)
边栏推荐
- Logstash failed to create queue
- JS - for cycle case: Horse grain
- VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
- 国债逆回购能开户吗,国债逆回购在APP上可以直接开通券商安全吗 ,买股票怎么网上开户
- 网络安全漏洞分析之重定向漏洞分析
- Uni app subcontracting loading and optimization
- ES6 use of dynamic attributes
- filebeat采集日志到ELK
- 【Pycharm踩坑记录】配置远程运行后提示,[Errno 2] No such file or directory
- 0.一些自己初学Solidworks的疑惑
猜你喜欢

redis

0.一些自己初學Solidworks的疑惑

Knowledge points related to system architecture 3

Vs installation of vassistx plug-in causes Chinese input of wpf-xaml file to be garbled. Solution

5. Attribute selector

Differences and uses among cookies, localstorage, sessionstorage, and application caching

On the use of regular expressions (bracket problem)

Centering problem - the width and height of child elements are known

JS - set countdown for Date object case

容器概念和云原生
随机推荐
Print an array clockwise
Problèmes et traitement du disque gbase 8a
anaconda下安装pytorch
Object in ES6 Use of entries()
DIY UAV (anonymous controller p2+f330 rack)
Container concept and cloud native
Filebeat collects logs to elk
JS array method
Namespace in TS (1)
WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
Judgment of single exclamation point and double exclamation point in JS
2020-12-28
[pychart pit stepping record] prompt after configuring remote operation, [errno 2] no such file or directory
GBase 8a V95与V86压缩策略类比
淘宝商品历史价格接口/商品历史价走势接口代码对接分享
Is it safe to open an account online? Can a novice open an account?
How does jupyter notebook directly output the values of multiple variables after running?
System analysis - detailed description
【Pycharm踩坑记录】配置远程运行后提示,[Errno 2] No such file or directory
Uni app subcontracting loading and optimization