openclimatefix / skillful_nowcasting

Implementation of DeepMind's Deep Generative Model of Radar (DGMR) https://arxiv.org/abs/2104.00954
MIT License
211 stars 59 forks source link

Issue with README instructions #25

Closed johmathe closed 2 years ago

johmathe commented 2 years ago

Describe the bug README instructions fail when initializing generator

To Reproduce

In [1]: from dgmr import DGMR, Sampler, Generator, Discriminator, LatentConditioningStack, ContextConditioningStack
   ...: model = DGMR().from_pretrained("openclimatefix/dgmr")
   ...: sampler = Sampler().from_pretrained("openclimatefix/dgmr-sampler")
   ...: generator = Generator().from_pretrained("openclimatefix/dgmr-generator")
   ...: discriminator = Discriminator().from_pretrained("openclimagefix/dgmr-discriminator")
   ...: latent_stack = LatentConditioningStack().from_pretrained("openclimatefix/dgmr-latent-conditioning-stack")
   ...: context_stack = ContextConditioningStack().from_pretrained("openclimatefix/dgmr-context-conditioning-stack")
"beta1":            0.0
"beta2":            0.999
"context_channels": 384
"conv_type":        standard
"disc_lr":          0.0002
"forecast_steps":   18
"gen_lr":           5e-05
"grid_lambda":      20.0
"input_channels":   1
"latent_channels":  768
"num_samples":      6
"output_shape":     256
"visualize":        False
"beta1":            0.0
"beta2":            0.999
"context_channels": 384
"conv_type":        standard
"disc_lr":          0.0002
"forecast_steps":   18
"gen_lr":           5e-05
"grid_lambda":      20.0
"input_channels":   1
"latent_channels":  768
"num_samples":      6
"output_shape":     256
"visualize":        False
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-05b2ce154150> in <module>
      2 model = DGMR().from_pretrained("openclimatefix/dgmr")
      3 sampler = Sampler().from_pretrained("openclimatefix/dgmr-sampler")
----> 4 generator = Generator().from_pretrained("openclimatefix/dgmr-generator")
      5 discriminator = Discriminator().from_pretrained("openclimagefix/dgmr-discriminator")
      6 latent_stack = LatentConditioningStack().from_pretrained("openclimatefix/dgmr-latent-conditioning-stack")

TypeError: __init__() missing 3 required positional arguments: 'conditioning_stack', 'latent_stack', and 'sampler'

Expected behavior I would expect the models to load.

Additional context N/A

jacobbieker commented 2 years ago

Thanks for pointing this out! I've updated the README with a method that works for the generator.