Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding Visdom #23

Open
nisargshah1999 opened this issue Apr 21, 2020 · 2 comments
Open

Regarding Visdom #23

nisargshah1999 opened this issue Apr 21, 2020 · 2 comments

Comments

@nisargshah1999
Copy link

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.

@LINFF1023
Copy link

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?

@liu-bohan
Copy link

liu-bohan commented Dec 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants