Commit df02a9a3 authored by Guillaume HEUSCH's avatar Guillaume HEUSCH

[trainers] added ConditionalGANTrainer in __init__, fixed display of error...

[trainers] added ConditionalGANTrainer in __init__, fixed display of error (tensor.item() for tensors with one element)
parent 6981317d
......@@ -186,7 +186,7 @@ class ConditionalGANTrainer(object):
optimizerG.step()
end = time.time()
logger.info("[{}/{}][{}/{}] => Loss D = {} -- Loss G = {} (time spent: {})".format(epoch, n_epochs, i, len(dataloader), errD.data[0], errG.data[0], (end-start)))
logger.info("[{}/{}][{}/{}] => Loss D = {} -- Loss G = {} (time spent: {})".format(epoch, n_epochs, i, len(dataloader), errD.item(), errG.item(), (end-start)))
# save generated images at every epoch
# TODO: model moved to CPU and back and I don't really know why (expected CPU tensor error)
......
from .CNNTrainer import CNNTrainer
from .DCGANTrainer import DCGANTrainer
from .ConditionalGANTrainer import ConditionalGANTrainer
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment