You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a bug in the save_image function of Art Generation with Neural Style Transfer code. Since .detach() share the same memory, we should clone the input image first or the change will apply to the original image and mess the training.
Bellow is the fixed code for save_image
def save_image(path, imageO):
# Un-normalize the image so that it looks good
image=imageO.clone().detach()
image = image.cpu().numpy().transpose(0, 2, 3, 1)
image += CONFIG.MEANS
image = np.clip(image[0], 0, 255).astype('uint8')
The text was updated successfully, but these errors were encountered:
I think there is a bug in the save_image function of Art Generation with Neural Style Transfer code. Since .detach() share the same memory, we should clone the input image first or the change will apply to the original image and mess the training.
Bellow is the fixed code for save_image
def save_image(path, imageO):
# Un-normalize the image so that it looks good
image=imageO.clone().detach()
image = image.cpu().numpy().transpose(0, 2, 3, 1)
image += CONFIG.MEANS
image = np.clip(image[0], 0, 255).astype('uint8')
Hi, I learn a lot from your code! Thanks a lot!
I think there is a bug in the
save_image
function ofArt Generation with Neural Style Transfer
code. Since .detach() share the same memory, we should clone the input image first or the change will apply to the original image and mess the training.Bellow is the fixed code for
save_image
The text was updated successfully, but these errors were encountered: