Hi, I try to log the residuals of the best model of the run and I cannot do it with the wandb_logger (lightning).
I do:
self.log("%s_residuals" % mode, residuals)
And I get:
Exception has occurred: ValueError
`self.log(val_residuals, tensor([ 922.9688, 892.0009, 1414.1432, 1549.3324, 1341.1199, 902.2733,
1103.2998, 1066.6083, 837.4913, 921.2358, 1132.7634, 1488.9233,
1219.2042, 640.6171, 875.3945, 1070.0031, 917.9532, 1288.4425,
1154.5270, 1156.2522, 914.9966, 1250.5038, 1070.0439, 1272.7135,
936.7913, 703.1593, 726.7241, 1387.6118, 1317.7161, 959.2494,
727.7173, 912.6650], device='cuda:0'))` was called, but the tensor must have a single element. You can try doing `self.log(val_residuals, tensor([ 922.9688, 892.0009, 1414.1432, 1549.3324, 1341.1199, 902.2733,
1103.2998, 1066.6083, 837.4913, 921.2358, 1132.7634, 1488.9233,
1219.2042, 640.6171, 875.3945, 1070.0031, 917.9532, 1288.4425,
1154.5270, 1156.2522, 914.9966, 1250.5038, 1070.0439, 1272.7135,
936.7913, 703.1593, 726.7241, 1387.6118, 1317.7161, 959.2494,
727.7173, 912.6650], device='cuda:0').mean())`
File "C:\github\absdabsde\absdabsde\absdabsde.py", line 241, in _calculate_loss
self.log("%s_residuals" % mode, residuals)
File "C:\github\absdabsde\absdabsde\absdabsde.py", line 209, in validation_step
self._calculate_loss(batch, mode="val")
File "C:\github\absdabsde\absdabsde\absdabsde.py", line 270, in train_model
trainer.fit(model, train_loader, val_loader)
File "C:\github\absdabsde\absdabsde\absdabsde.py", line 290, in <module>
model, results = train_model(
ValueError: `self.log(val_residuals, tensor([ 922.9688, 892.0009, 1414.1432, 1549.3324, 1341.1199, 902.2733,
1103.2998, 1066.6083, 837.4913, 921.2358, 1132.7634, 1488.9233,
1219.2042, 640.6171, 875.3945, 1070.0031, 917.9532, 1288.4425,
1154.5270, 1156.2522, 914.9966, 1250.5038, 1070.0439, 1272.7135,
936.7913, 703.1593, 726.7241, 1387.6118, 1317.7161, 959.2494,
727.7173, 912.6650], device='cuda:0'))` was called, but the tensor must have a single element. You can try doing `self.log(val_residuals, tensor([ 922.9688, 892.0009, 1414.1432, 1549.3324, 1341.1199, 902.2733,
1103.2998, 1066.6083, 837.4913, 921.2358, 1132.7634, 1488.9233,
1219.2042, 640.6171, 875.3945, 1070.0031, 917.9532, 1288.4425,
1154.5270, 1156.2522, 914.9966, 1250.5038, 1070.0439, 1272.7135,
936.7913, 703.1593, 726.7241, 1387.6118, 1317.7161, 959.2494,
727.7173, 912.6650], device='cuda:0').mean())
Any suggestion on how I can log my best model’s residuals will be helpful!!