MACE: transfer atomic numbers to CPU before converting to numpy. #289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I get the following error when trying to use the MACE model for structural optimization (or MD):
This PR fixes this error by transferring the
atomic_numbersto the CPU first (in case the data is on the GPU, which should be the case), before converting thetensortonumpy.I just used the example scripts or tried to follow the instructions in the
README: https://github.com/TorchSim/torch-sim/tree/v0.4.0?tab=readme-ov-file#running-batched-relaxationI'm not sure whether this was really a problem or whether I just did something else in a wrong way, as I'd expect that this would have been encountered before. Nonetheless, also comparing with other models, this change seems to be reasonable.
If this is not a bug, just close this PR 😄