Skip to content

Running error in the mtp example in notebook #601

Open
@tomblister

Description

@tomblister

Email (Optional)

[email protected]

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions