From 83ab7990a6db98c897b8c6d97442a78f251c62f4 Mon Sep 17 00:00:00 2001 From: Luis Barroso-Luque Date: Fri, 13 Sep 2024 16:40:52 -0700 Subject: [PATCH] do not shadow built-in property (#841) --- src/fairchem/core/trainers/ocp_trainer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fairchem/core/trainers/ocp_trainer.py b/src/fairchem/core/trainers/ocp_trainer.py index 0fc5d1f7e..a50dc672c 100644 --- a/src/fairchem/core/trainers/ocp_trainer.py +++ b/src/fairchem/core/trainers/ocp_trainer.py @@ -258,8 +258,8 @@ def _forward(self, batch): assert ( "property" in self.output_targets[target_key] ), f"we need to know which property to match the target to, please specify the property field in the task config, current config: {self.output_targets[target_key]}" - property = self.output_targets[target_key]["property"] - pred = out[target_key][property] + prop = self.output_targets[target_key]["property"] + pred = out[target_key][prop] ## TODO: deprecate the following logic? ## Otherwise, assume target property is a derived output of the model. Construct the parent property