# coding=utf-8
import sys
sys.path.append('../yolov5')

import torch

weights_file = your_path+'best.pt'
ckpt = torch.load(weights_file)
print(type(ckpt))
# ckpt.keys(): dict_keys(['epoch', 'best_fitness', 'model', 'ema', 'updates', 'optimizer', 'wandb_id', 'training_results'])
cnt = 0
for name,weights in ckpt['model'].named_parameters():
    cnt+=1
    print('[{}] -----------------------'.format(cnt))
    print(name,':',weights.size())
    print(weights.detach())

  

相关文章:

  • 2023-03-17
  • 2021-05-04
  • 2022-12-23
  • 2021-06-22
  • 2021-10-26
  • 2021-12-17
  • 2021-11-09
  • 2021-10-04
猜你喜欢
  • 2022-01-21
  • 2021-06-04
  • 2022-02-14
  • 2022-01-27
  • 2021-07-23
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案