PyTorch-CycleGAN icon indicating copy to clipboard operation
PyTorch-CycleGAN copied to clipboard

Regarding Visdom

Open nisargshah1999 opened this issue 4 years ago • 2 comments

Hi, Thank you very much for easy implementation of Cyclgan code. I am training on the server and couldn't use web browser to visualize the results. So is there a way that I could stop that part in code as it is continuously giving errorss.

nisargshah1999 avatar Apr 21 '20 19:04 nisargshah1999

Hi, Thank you very much for easy implementation of Cyclgan code. I am training on the server and couldn't use web browser to visualize the results. So is there a way that I could stop that part in code as it is continuously giving errorss.

hi!!! How did you solve it?

LINFF1023 avatar Nov 23 '22 03:11 LINFF1023

How did you solve it?

I just commented out all the code about Visdom. They're all in the utils.py file:

from torch.autograd import Variable
import torch
#from visdom import Visdom
import numpy as np
... ...
class Logger():
    def __init__(self, n_epochs, batches_epoch):
        #self.viz = Visdom()
        self.n_epochs = n_epochs
        self.batches_epoch = batches_epoch
        self.epoch = 1
        ... ...
 # Draw images
        '''
        for image_name, tensor in images.items():
            if image_name not in self.image_windows:
                self.image_windows[image_name] = self.viz.image(tensor2image(tensor.data), opts={'title':image_name})
            else:
                self.viz.image(tensor2image(tensor.data), win=self.image_windows[image_name], opts={'title':image_name})
        '''
# End of epoch
        if (self.batch % self.batches_epoch) == 0:
            # Plot losses
            for loss_name, loss in self.losses.items():
                '''
                if loss_name not in self.loss_windows:
                    self.loss_windows[loss_name] = self.viz.line(X=np.array([self.epoch]), Y=np.array([loss/self.batch]),
                                                                    opts={'xlabel': 'epochs', 'ylabel': loss_name, 'title': loss_name})
                else:
                    self.viz.line(X=np.array([self.epoch]), Y=np.array([loss/self.batch]), win=self.loss_windows[loss_name], update='append')
                '''
                # Reset losses for next epoch
                self.losses[loss_name] = 0.0

liu-bohan avatar Dec 01 '23 11:12 liu-bohan