How to construct a U-Net with pretrained Resnet model in PyTorch?

I’ve seen some blogs talking about using a resnet as the encoder part of a U-Net.
Can I use a pretrained resnet?
In other words, how can we get the results intermediate layers from the pretrained resnet model since we need result from previous layers to do the cross connection.