Skip to content

Instantly share code, notes, and snippets.

@ShigekiKarita
Created June 10, 2020 02:02
Show Gist options
  • Save ShigekiKarita/d8f8e433257178e0c1306527f10fe93f to your computer and use it in GitHub Desktop.
Save ShigekiKarita/d8f8e433257178e0c1306527f10fe93f to your computer and use it in GitHub Desktop.
# Count the number of parameters in the saved model.
import torch
# Run this commands to get this model.
# $ cd $ESPNET_ROOT/egs/mini_an4/asr1; ./run.sh
state = torch.load("./exp/train_nodev_pytorch_train/results/model.acc.best")
print(sum(v.numel() for v in state.values()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment