ptrblck:

You don’t have to assign the trained_model to load_state_dict


as mentioned in the answer, you do not need to assign the model to return value of load_state_dict().
Use of the following is enough:
G.load_state_dict(torch.load('G.pth'))
...
img = G(z)