stfc / janus-core

Tools for machine learnt interatomic potentials
https://stfc.github.io/janus-core/
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

invalid model produces no warning #193

Closed alinelena closed 2 months ago

alinelena commented 2 months ago

if one specifies an invalid model (eg file does not exist) janus gets some default... but no warning is printed to let the user know... model loading failed.

ElliottKasoar commented 2 months ago

Do you have an example?

If I run janus singlepoint --struct tests/data/NaCl.cif --arch mace --calc-kwargs "{'model' : 'example'}" then the error (from MACE) seems fairly clear: ValueError: Couldn't find MACE model files: example

alinelena commented 2 months ago

yes was with config

device: cuda
fmax: 0.01
arch: mace_mp
steps: 1000
calc-kwargs:
    calc_kwargs:
      dispersion: True
      model: mace_agnesi_medium.model
ElliottKasoar commented 2 months ago

Why do you have calc-kwargs: calc_kwargs?

I think if you get rid of the second one and reduce the nesting of model you get the expected error. This happens as it's acting as if no model has been passed, which is why it uses the default.

I'm not sure we can validate kwargs sufficiently to catch cases like this particularly straightforwardly.

alinelena commented 2 months ago

silly me yap we have it few times.. in the configs repo

ElliottKasoar commented 2 months ago

Ah ok, opened an issue there: https://github.com/stfc/janus-tutorials/issues/7