94 TorchInfo

For a Tensorflow model, you can use .summary() to see the structure of your model. In pytorch, there is no such thing. So instead, you can use torchinfo.

This was really useful when I wanted to do transfer-learning but didn’t know what was going on inside the original network.

  1. Install torchinfo
    pip install torchinfo
    
  2. Display Summary
    from torchinfo import summary
    
    #Load your model
    model = load_model()
    summary(model=model, input_size=(batch_size, Channel, Height, Width))