diff --git a/ocp-tutorial/advanced/embeddings.ipynb b/ocp-tutorial/advanced/embeddings.ipynb index f2bddf7..ba45edd 100644 --- a/ocp-tutorial/advanced/embeddings.ipynb +++ b/ocp-tutorial/advanced/embeddings.ipynb @@ -75,7 +75,7 @@ "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", "import os\n", "cp = checkpoint = get_checkpoint('GemNet-OC OC20+OC22')\n", - "calc = OCPCalculator(checkpoint=cp)" + "calc = OCPCalculator(checkpoint_path=cp)" ] }, { diff --git a/ocp-tutorial/advanced/fine-tuning-in-python.ipynb b/ocp-tutorial/advanced/fine-tuning-in-python.ipynb index 9bb5a36..df293cc 100644 --- a/ocp-tutorial/advanced/fine-tuning-in-python.ipynb +++ b/ocp-tutorial/advanced/fine-tuning-in-python.ipynb @@ -227,7 +227,7 @@ "source": [ "checkpoint = get_checkpoint('GemNet-OC OC20+OC22')\n", "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", - "calc = OCPCalculator(checkpoint=checkpoint, trainer='forces', cpu=False)" + "calc = OCPCalculator(checkpoint_path=checkpoint, trainer='forces', cpu=False)" ] }, { @@ -292,11 +292,13 @@ ], "source": [ "yml = generate_yml_config(checkpoint, 'config.yml',\n", - " delete=['slurm', 'cmd', 'logger', 'task', 'model_attributes',\n", + " delete=['slurm', 'cmd', 'logger', 'model_attributes',\n", " 'optim.loss_force', # the checkpoint setting causes an error\n", " 'dataset', 'test_dataset', 'val_dataset'],\n", " update={'gpus': 1,\n", " 'task.dataset': 'ase_db',\n", + " 'dataset.format': 'ase_db',\n", + " 'task.primary_metric': 'forces_mae',\n", " 'optim.eval_every': 1,\n", " 'optim.max_epochs': 5,\n", " # Train data\n", diff --git a/ocp-tutorial/advanced/mass-inference.ipynb b/ocp-tutorial/advanced/mass-inference.ipynb index dfb4df4..a670d84 100644 --- a/ocp-tutorial/advanced/mass-inference.ipynb +++ b/ocp-tutorial/advanced/mass-inference.ipynb @@ -522,7 +522,7 @@ ], "source": [ "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", - "calc = OCPCalculator(checkpoint=os.path.expanduser(checkpoint), cpu=False)" + "calc = OCPCalculator(checkpoint_path=os.path.expanduser(checkpoint), cpu=False)" ] }, { diff --git a/ocp-tutorial/fine-tuning/fine-tuning-oxides.ipynb b/ocp-tutorial/fine-tuning/fine-tuning-oxides.ipynb index bccbcb9..912224f 100644 --- a/ocp-tutorial/fine-tuning/fine-tuning-oxides.ipynb +++ b/ocp-tutorial/fine-tuning/fine-tuning-oxides.ipynb @@ -343,7 +343,7 @@ ], "source": [ "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", - "calc = OCPCalculator(checkpoint=checkpoint, trainer='forces', cpu=False)" + "calc = OCPCalculator(checkpoint_path=checkpoint, trainer='forces', cpu=False)" ] }, { @@ -653,11 +653,13 @@ ], "source": [ "yml = generate_yml_config(checkpoint, 'config.yml',\n", - " delete=['slurm', 'cmd', 'logger', 'task', 'model_attributes',\n", + " delete=['slurm', 'cmd', 'logger', 'model_attributes',\n", " 'optim.loss_force', # the checkpoint setting causes an error\n", " 'dataset', 'test_dataset', 'val_dataset'],\n", " update={'gpus': 1,\n", " 'task.dataset': 'ase_db',\n", + " 'dataset.format': 'ase_db',\n", + " 'task.primary_metric': 'forces_mae',\n", " 'optim.eval_every': 1,\n", " 'optim.max_epochs': 10,\n", " # Train data\n", @@ -1007,7 +1009,7 @@ ], "source": [ "newckpt = cpdir + '/checkpoint.pt'\n", - "newcalc = OCPCalculator(checkpoint=newckpt, cpu=False)" + "newcalc = OCPCalculator(checkpoint_path=newckpt, cpu=False)" ] }, { diff --git a/ocp-tutorial/gotchas.ipynb b/ocp-tutorial/gotchas.ipynb index d30733d..710521f 100644 --- a/ocp-tutorial/gotchas.ipynb +++ b/ocp-tutorial/gotchas.ipynb @@ -67,7 +67,7 @@ "%%capture\n", "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", "cp = \"gnoc_oc22_oc20_all_s2ef.pt\"\n", - "calc = OCPCalculator(checkpoint=cp)" + "calc = OCPCalculator(checkpoint_path=cp)" ] }, { @@ -185,7 +185,7 @@ "checkpoint = get_checkpoint('GemNet-OC All')\n", "\n", "with contextlib.redirect_stdout(StringIO()) as _:\n", - " calc = OCPCalculator(checkpoint=os.path.expanduser(checkpoint), cpu=False)\n", + " calc = OCPCalculator(checkpoint_path=os.path.expanduser(checkpoint), cpu=False)\n", " \n", "\n", "\n", @@ -230,7 +230,7 @@ "checkpoint = get_checkpoint('GemNet-OC OC22')\n", "\n", "with contextlib.redirect_stdout(StringIO()) as _:\n", - " calc = OCPCalculator(checkpoint=checkpoint, cpu=False)\n", + " calc = OCPCalculator(checkpoint_path=checkpoint, cpu=False)\n", " \n", "\n", "\n", @@ -260,7 +260,7 @@ "checkpoint = get_checkpoint('eSCN-L4-M2-Lay12 2M')\n", "\n", "with contextlib.redirect_stdout(StringIO()) as _:\n", - " calc = OCPCalculator(checkpoint=checkpoint, cpu=False)\n", + " calc = OCPCalculator(checkpoint_path=checkpoint, cpu=False)\n", "\n", "slab.set_calculator(calc)\n", "slab.get_potential_energy()" @@ -329,7 +329,7 @@ "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", "import os\n", "cp = checkpoint = get_checkpoint('GemNet-OC OC20+OC22')\n", - "calc = OCPCalculator(checkpoint=cp)" + "calc = OCPCalculator(checkpoint_path=cp)" ] }, { @@ -395,7 +395,7 @@ "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", "import os\n", "cp = checkpoint = get_checkpoint('GemNet-OC OC20+OC22')\n", - "calc = OCPCalculator(checkpoint=cp)" + "calc = OCPCalculator(checkpoint_path=cp)" ] }, { @@ -481,7 +481,7 @@ "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", "import os\n", "cp = checkpoint = get_checkpoint('eSCN-L6-M3-Lay20 All+MD')\n", - "calc = OCPCalculator(checkpoint=cp)" + "calc = OCPCalculator(checkpoint_path=cp)" ] }, { @@ -547,7 +547,7 @@ "checkpoint = get_checkpoint('eSCN-L6-M3-Lay20 All+MD')\n", "\n", "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", - "calc = OCPCalculator(checkpoint=os.path.expanduser(checkpoint), cpu=True)\n", + "calc = OCPCalculator(checkpoint_path=os.path.expanduser(checkpoint), cpu=True)\n", "\n", "from ase.build import fcc111, add_adsorbate\n", "from ase.optimize import BFGS\n", @@ -702,7 +702,7 @@ "checkpoint = get_checkpoint('eSCN-L6-M3-Lay20 All+MD')\n", "\n", "from ocpmodels.common.relaxation.ase_utils import OCPCalculator\n", - "calc = OCPCalculator(checkpoint=os.path.expanduser(checkpoint), cpu=True)\n", + "calc = OCPCalculator(checkpoint_path=os.path.expanduser(checkpoint), cpu=True)\n", "\n", "from ase.build import fcc111, add_adsorbate\n", "from ase.optimize import BFGS\n", diff --git a/ocp-tutorial/ocp-tutorial.ipynb b/ocp-tutorial/ocp-tutorial.ipynb index aad8d0a..edd15e4 100644 --- a/ocp-tutorial/ocp-tutorial.ipynb +++ b/ocp-tutorial/ocp-tutorial.ipynb @@ -289,7 +289,7 @@ " # see the output though, so I capture it.\n", "\n", " with contextlib.redirect_stdout(StringIO()) as _:\n", - " config = OCPCalculator(checkpoint=checkpoint_path).config\n", + " config = OCPCalculator(checkpoint_path=checkpoint_path).config\n", " \n", " for key in delete:\n", " if key in config and len(key.split('.')) == 1:\n",