ACEsuit / mace

MACE - Fast and accurate machine learning interatomic potentials with higher order equivariant message passing.
Other
554 stars 205 forks source link

Refactor data module #674

Open ilyes319 opened 2 weeks ago

LarsSchaaf commented 2 weeks ago

Currently doesn't support wandb, as gives this error:

TypeError: Object of type KeySpecification is not JSON serializable

From line:

args_dict_json = json.dumps(args_dict)

One solution:

class CustomEncoder(json.JSONEncoder):
    def default(self, obj):
        if isinstance(obj, KeySpecification): 
            return obj.__dict__  
        return super().default(obj)

args_dict_json = json.dumps(args_dict, cls=CustomEncoder)