extremety1989:

but if i want only to do forward pass i get that error… i do not understand why …


The forward pass is not raising the error, but the save_image applied on a list of tensors with different shapes.
Remove
save_image(new_img, 'output.png')

and it should work or alternatively store each slice of each intermediate activation separately.