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

Running error in the mtp example in notebook #601

Open
2 of 4 tasks
tomblister opened this issue Mar 7, 2024 · 1 comment
Open
2 of 4 tasks

Running error in the mtp example in notebook #601

tomblister opened this issue Mar 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tomblister
Copy link

Email (Optional)

tomblister@gmail.com

Version

v2023.9.9

Which OS(es) are you using?

  • MacOS
  • Windows
  • Linux

What happened?

Dear Sir,
I was running through the pes examples in the notebook of maml. However, when I ran the following step in the mtp example:

mtp.train(
train_structures=train_structures,
train_energies=train_energies,
train_forces=train_forces,
train_stresses=None,
max_dist=5,
stress_weight=0,
)

the following returned:

**INFO:maml.utils._lammps:Structure index 0 is rotated.
INFO:maml.utils._lammps:Structure index 1 is rotated.
INFO:maml.utils._lammps:Structure index 2 is rotated.
INFO:maml.utils._lammps:Structure index 3 is rotated.
INFO:maml.utils._lammps:Structure index 4 is rotated.
INFO:maml.utils._lammps:Structure index 5 is rotated.
INFO:maml.utils._lammps:Structure index 6 is rotated.
INFO:maml.utils._lammps:Structure index 7 is rotated.
INFO:maml.utils._lammps:Structure index 8 is rotated.
INFO:maml.utils._lammps:Structure index 9 is rotated.

ValueError Traceback (most recent call last)
Cell In[3], line 1
----> 1 mtp.train(
2 train_structures=train_structures,
3 train_energies=train_energies,
4 train_forces=train_forces,
5 train_stresses=None,
6 max_dist=5,
7 stress_weight=0,
8 )

File /opt/anaconda3/envs/myenv/lib/python3.8/site-packages/maml/apps/pes/_mtp.py:602, in MTPotential.train(self, train_structures, train_energies, train_forces, train_stresses, unfitted_mtp, max_dist, radial_basis_size, max_iter, energy_weight, force_weight, stress_weight, init_params, scale_by_force, bfgs_conv_tol, weighting)
600 with open("min_dist") as f:
601 lines = f.readlines()
--> 602 min_dist = float(lines[-1].split(":")[1])
604 with open(unfitted_mtp) as f:
605 template = f.read()

ValueError: could not convert string to float: ' command mindist does not exist.\n'

I could not find the "min_dist" in the example. Could you please offer me some help on this issue? Thank you!

Code snippet

mtp.train(
    train_structures=train_structures,
    train_energies=train_energies,
    train_forces=train_forces,
    train_stresses=None,
    max_dist=5,
    stress_weight=0,
)

Log output

INFO:maml.utils._lammps:Structure index 0 is rotated.
INFO:maml.utils._lammps:Structure index 1 is rotated.
INFO:maml.utils._lammps:Structure index 2 is rotated.
INFO:maml.utils._lammps:Structure index 3 is rotated.
INFO:maml.utils._lammps:Structure index 4 is rotated.
INFO:maml.utils._lammps:Structure index 5 is rotated.
INFO:maml.utils._lammps:Structure index 6 is rotated.
INFO:maml.utils._lammps:Structure index 7 is rotated.
INFO:maml.utils._lammps:Structure index 8 is rotated.
INFO:maml.utils._lammps:Structure index 9 is rotated.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[3], line 1
----> 1 mtp.train(
      2     train_structures=train_structures,
      3     train_energies=train_energies,
      4     train_forces=train_forces,
      5     train_stresses=None,
      6     max_dist=5,
      7     stress_weight=0,
      8 )

File /opt/anaconda3/envs/myenv/lib/python3.8/site-packages/maml/apps/pes/_mtp.py:602, in MTPotential.train(self, train_structures, train_energies, train_forces, train_stresses, unfitted_mtp, max_dist, radial_basis_size, max_iter, energy_weight, force_weight, stress_weight, init_params, scale_by_force, bfgs_conv_tol, weighting)
    600 with open("min_dist") as f:
    601     lines = f.readlines()
--> 602 min_dist = float(lines[-1].split(":")[1])
    604 with open(unfitted_mtp) as f:
    605     template = f.read()

ValueError: could not convert string to float: ' command mindist does not exist.\n'

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tomblister tomblister added the bug Something isn't working label Mar 7, 2024
@zz11ss11zz
Copy link
Contributor

@tomblister Hi, could you check which version of the mlip package you are using? This maml is suited for mlip-2. The min_dist is generated in a temporary file during the code running and this file will be deleted after the code finishes running.

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

2 participants