About the error "'GlobalStorage' object has no attribute 'y_relaxed'"

Dear the team,

I used my own data-OUTCAR to train the model-painn, but it did work.
Here is my dataset content:

dataset:
  train:
    src: D:\path # The folder that contains ASE-readable files
    pattern: "*/OUTCAR" # Pattern matching each file you want to read (e.g. "*/POSCAR"). Search recursively with two wildcards: "**/*.cif".
    a2g_args:
      r_energy: True
    ase_read_args:
      # Keyword arguments for ase.io.read()
      #filename: '*/OUTCAR'
      format: vasp-out
      index: '-1'
    keep_in_memory: False
  val:
    src: D:\path # The folder that contains ASE-readable files
    pattern: "*/OUTCAR" # Pattern matching each file you want to read (e.g. "*/POSCAR"). Search recursively with two wildcards: "**/*.cif".
    a2g_args:
      r_energy: True
    ase_read_args:
      # Keyword arguments for ase.io.read()
      #filename: 'OUTCAR'
      format: vasp-out
      index: '-1'
    keep_in_memory: False
  test:
    src: D:\data\ldh\crmnfecu\O # The folder that contains ASE-readable files
    pattern: "*/POSCAR" # Pattern matching each file you want to read (e.g. "*/POSCAR"). Search recursively with two wildcards: "**/*.cif".
    ase_read_args:
      # Keyword arguments for ase.io.read()
      format: vasp
      index: '0'

    keep_in_memory: False

logger: wandb

task:
  dataset: ase_read
  description: "Relaxed state energy prediction from initial structure."
  type: regression
  metric: mae
  primary_metric: energy_mae
  labels:
    - relaxed energy

I got the error like :
Traceback (most recent call last): File "D:\python\ocp-main\ocp-main\main.py", line 94, in <module> Runner()(config) File "D:\python\ocp-main\ocp-main\main.py", line 38, in __call__ self.task.run() File "D:\python\ocp-main\ocp-main\ocpmodels\tasks\task.py", line 51, in run self.trainer.train( File "D:\python\ocp-main\ocp-main\ocpmodels\trainers\energy_trainer.py", line 204, in train loss = self._compute_loss(out, batch) File "D:\python\ocp-main\ocp-main\ocpmodels\trainers\energy_trainer.py", line 315, in _compute_loss [batch.y_relaxed.to(self.device) for batch in batch_list], dim=0 File "D:\python\ocp-main\ocp-main\ocpmodels\trainers\energy_trainer.py", line 315, in <listcomp> [batch.y_relaxed.to(self.device) for batch in batch_list], dim=0 File "C:\Users\Windows11\anaconda3\envs\ocp-models\lib\site-packages\torch_geometric\data\data.py", line 441, in __getattr__ return getattr(self._store, key) File "C:\Users\Windows11\anaconda3\envs\ocp-models\lib\site-packages\torch_geometric\data\storage.py", line 81, in __getattr__ raise AttributeError( AttributeError: 'GlobalStorage' object has no attribute 'y_relaxed'
I didn’t find the y_relaxed in the code(energy_trainer.py).
Could you help me with this?

The solution to this problem depends on if you are trying to train an “S2EF” or “IS2RE Direct” model.

  1. For an S2EF model:
    Please make sure you are using the Forces Trainer. This will require you to have forces in your training and validation data sets (I hope this is not a problem since you already have OUTCARs). You will also have to set the following in each section of the dataset config:
a2g_args:
    r_forces: True
  1. For an IS2RE Direct model:
    This is not currently possible with the ASE Datasets. I am working on a patch that you can try out now if you like. Note that in this case you probably do not want to specify index: '-1' in the training and validation sets. Instead you will probably want to either use 'index: '0' to get the initial positions only or switch to the ase_read_multi dataset to train on every frame.