cc-ai / climategan

Code and pre-trained model for the algorithm generating visualisations of 3 climate change related events: floods, wildfires and smog.
https://thisclimatedoesnotexist.com
GNU General Public License v3.0
75 stars 18 forks source link

fix tests and fix other small things #100

Closed tianyu-z closed 4 years ago

tianyu-z commented 4 years ago

I fixed the first 3 tests: test_losses.py: Issue: line 42, there is no "s" in key. We should change it to "x" or "m" test_trainer.py: Issue: there is no function named "freeze" anymore. I think we need to delete it. there is no "get_representation_loss" anymore. It should be "get_masker_loss" now. line 180, the trainer.losses["D"] is a dict now. 'dict' object has no attribute 'verbose' test_dis.py: Issue: the rand image has 3 channels but advent discriminator need a 2 (number of class) channel one. Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

test_gen.py: (I didn't fix this yet.)
Traceback (most recent call last):
  File "test_gen.py", line 120, in <module>
    out2 = G.painter(z, image * mask)
  File "/home/mila/t/tianyu.zhang/myenv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/mila/t/tianyu.zhang/myenv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 103, in forward
    raise NotImplementedError
NotImplementedError
tianyu-z commented 4 years ago

Besides, I think maybe we also need to test get_painter_loss in the test_trainer.py.