How can I calculate FLOPs and Params without 0 weights neurons affected?
问题 My Prune code is shown below, after running this, I will get a file named 'pruned_model.pth'. import torch from torch import nn import torch.nn.utils.prune as prune import torch.nn.functional as F from cnn import net ori_model = '/content/drive/My Drive/ECG_weight_prune/checkpoint_dir/model.pth' save_path = '/content/drive/My Drive/ECG_weight_prune/checkpoint_dir/pruned_model.pth' device = torch.device("cuda" if torch.cuda.is_available() else "cpu") model = net().to(device) model.load_state