m2lines / gz21_ocean_momentum

Stochastic-Deep Learning Parameterization of Ocean Momentum Forcing
MIT License
5 stars 1 forks source link

net.cuda(device) leads to error if no cuda device #70

Closed MarionBWeinzierl closed 1 year ago

MarionBWeinzierl commented 1 year ago

https://github.com/m2lines/gz21_ocean_momentum/blob/ef0c1c59e311f8c2b07671f30e8e711819b43175/src/gz21_ocean_momentum/trainScript.py#L388 leads to an error:

RuntimeError: Invalid device, must be cuda device

if run on a CPU.

Should be replaced by

net.to(device)

(I think)

MarionBWeinzierl commented 1 year ago

Fixed by #73