Since your encoder output will have 1024 channels, you would have to make sure that the first conv layer of resnet accepts this number of input channels.
By default the first layer will accept 3 input channeld (RGB image tensor), and you could replace it via:
model = models.resnet50()
conv1 = model.conv1
model.conv1 = nn.Conv2d(
    1024, conv1.out_channels, conv1.kernel_size, conv1.stride, conv1.padding,
    conv.dilation, conv1.groups, conv1.bias)

I’m not sure how large the spatial size of your encoder output is, but rensets were trained on inputs with a resolution of 224x224.
That being said, since an adaptive pooling layer is used before the linear layer, your are flexible regarding the spatial size as long as it’s not too small and is too small for some layers.