Currently #33 hacks the utils/model_definition.py to disable an if condition that isn't used for 1x1 model but causes issue when trying to script
|
# if self.fac == 1: |
|
# x = torch.squeeze(self.dropout0(self.act_cnn(self.conv1(x)))) |
|
# elif self.fac == 2: |
|
# x = torch.squeeze(self.dropout0(self.act_cnn(self.conv1(x)))) |
|
# x = torch.squeeze(self.dropout0_2(self.act_cnn2(self.conv2(x)))) |
Error:
RuntimeError:
Module 'ANN_CNN' has no attribute 'dropout0' :
File "/home/melt/sync/cambridge/projects/current/nlgw-cam/nonlocal_gwfluxes/era5_training/../utils/model_definition.py", line 75
def forward(self, x):
if self.fac == 1:
x = torch.squeeze(self.dropout0(self.act_cnn(self.conv1(x))))
~~~~~~~~~~~~~ <--- HERE
elif self.fac == 2:
x = torch.squeeze(self.dropout0(self.act_cnn(self.conv1(x))))
Currently #33 hacks the
utils/model_definition.pyto disable an if condition that isn't used for 1x1 model but causes issue when trying to scriptnonlocal_gwfluxes/utils/model_definition.py
Lines 74 to 78 in c389d75
Error: