Could you print some info about content in your train method?
It seems it’s a list instead of a tensor.
Since you are using ImageFolder for your Dataset, your content_loader should return a data and target tensor for each batch.
You could try to pass content[0] to your self.transform_network, if you don’t need the target.
Also, you should call the model directly instead of its forward method to make sure that all hooks are properly registered: pastiche = self.transform_network(content[0]).