Using a Pruned Model - 1.4.1 English

Vitis AI Optimizer User Guide (UG1333)

Document ID
UG1333
Release Date
2021-10-29
Version
1.4.1 English

You can use the generated Python script to create a pruned model and then load dense weights on it. The dense weights are obtained and saved by ‘pruned_state_dict()’ during fine-tuning.

from pruned_resnet18 import ResNet

model = ResNet()
model.load_state_dict(torch.load('resnet18_dense_best.pth'))