Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] Smaller dataset when using initialize_from_state #460

Open
wwz171 opened this issue Sep 6, 2024 · 0 comments
Open

🐛 [BUG] Smaller dataset when using initialize_from_state #460

wwz171 opened this issue Sep 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wwz171
Copy link

wwz171 commented Sep 6, 2024

Bug Description

When I try to train a pre-trained model on a smaller dataset, I get the following error:

Traceback (most recent call last):
  File "/home/weizhouwang/.conda/envs/NEQUIP/bin/nequip-train", line 10, in <module>
    sys.exit(main())
  File "/home/weizhouwang/.conda/envs/NEQUIP/lib/python3.9/site-packages/nequip/scripts/train.py", line 110, in main
    trainer = fresh_start(config)
  File "/home/weizhouwang/.conda/envs/NEQUIP/lib/python3.9/site-packages/nequip/scripts/train.py", line 240, in fresh_start
    trainer.set_dataset(dataset, validation_dataset)
  File "/home/weizhouwang/.conda/envs/NEQUIP/lib/python3.9/site-packages/nequip/train/trainer.py", line 1263, in set_dataset
    self.dataset_train = dataset.index_select(self.train_idcs)
  File "/home/weizhouwang/.conda/envs/NEQUIP/lib/python3.9/site-packages/nequip/utils/torch_geometric/dataset.py", line 220, in index_select
    return self.index_select(idx.flatten().tolist())
  File "/home/weizhouwang/.conda/envs/NEQUIP/lib/python3.9/site-packages/nequip/utils/torch_geometric/dataset.py", line 234, in index_select
    indices = [indices[i] for i in idx]
  File "/home/weizhouwang/.conda/envs/NEQUIP/lib/python3.9/site-packages/nequip/utils/torch_geometric/dataset.py", line 234, in <listcomp>
    indices = [indices[i] for i in idx]
IndexError: range object index out of range

The model is trained on a bigger dataset, but I want to fine-tune it on a smaller dataset. And it goes wrong.

I guess the error is caused by config.yaml file of key include_file_as_baseline_config: there's a train_idcs and val_idcs in it which indicate the indices of the training and validation data. When I train the model on a smaller dataset, the indices are out of range. After I delete these two lines, the error is gone.

@wwz171 wwz171 added the bug Something isn't working label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant