I ran into this issue while going through: https://towardsdatascience.com/visualizing-convolution-neural-networks-using-pytorch-3dfa8443e74e 14 since I was using ResNet50 instead of the model from the article.
The solution I came up with was:
features = []
# model._modules came from: https://github.com/utkuozbulak/pytorch-cnn-visualizations/issues/50#issuecomment-531757757
for key,value in model._modules.items():
    features.append(value)

where model is the model I created and then instead of doing model.features I just reference it as features since it’s a separate object.