How to delete layer(not Sequential) in pretrained model?

Using pretrain model(ImageNet), I want to edit model to fit cifar dataset resnet architecture.

I can edit layer, but don’t know how to delete what I don’t want to use.
Please let me know.
Thank you.

See this topic.


Oh, Thank you so much! ^^

Then can I ask you one more Q?

Do you know how to get hidden activation output?
In pretrained resnet model, I want to get each blocks output !
Thank you.

Search register_hook or register_forward_hook in PyTorch Forums.

One example is Understanding-Pytorch-Hooks.

Or you can also search PyTorch Hook in Google to learn more.