{"id":27733,"library":"fairchem-core","title":"FAIR-Chem Core","description":"fairchem-core is the core package of the FAIR Chemistry library, providing machine learning models (e.g., GemNet-OC, DimeNet++) for chemistry and materials science. Version 2.19.0 supports Python 3.11 to 3.13. The library is actively maintained and released every few months.","status":"active","version":"2.19.0","language":"python","source_language":"en","source_url":"https://github.com/FAIR-Chem/fairchem","tags":["chemistry","materials science","machine learning","neural networks","OC20"],"install":[{"cmd":"pip install fairchem-core","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"The correct module is `datasets`, not `data`.","wrong":"from fairchem.core.data import OC20Dataset","symbol":"OC20Dataset","correct":"from fairchem.core.datasets import OC20Dataset"}],"quickstart":{"code":"import torch\nfrom fairchem.core.models import GemNetOC\nfrom fairchem.core.datasets import OC20Dataset\n\ndataset = OC20Dataset(\"s2ef\", split=\"train\", subset=\"200k\", root=\"./data\")\nloader = torch.utils.data.DataLoader(dataset, batch_size=32, shuffle=True)\nmodel = GemNetOC()\noutput = model(next(iter(loader)))\nprint(output)","lang":"python","description":"Minimal example: load OC20 S2EF dataset, create a model, and run a forward pass."},"warnings":[{"fix":"Update imports to use `fairchem.core` instead of `fairchem`.","message":"The package structure changed from `fairchem` to `fairchem.core` in version 2.0. Code using `from fairchem import ...` will break.","severity":"breaking","affected_versions":"<2.0"},{"fix":"Install PyTorch with CUDA: `pip install torch --index-url https://download.pytorch.org/whl/cu118`","message":"Requires PyTorch with CUDA. CPU-only will fail if GPU expects CUDA tensors.","severity":"gotcha","affected_versions":">=2.0"},{"fix":"Use `OC20Dataset` with `task='oc22'` if available.","message":"The `OC22Dataset` is deprecated in favor of `OC20Dataset` with appropriate parameters.","severity":"deprecated","affected_versions":">=2.10"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Change import to `from fairchem.core.datasets import OC20Dataset`.","cause":"Incorrect import path; the dataset classes are in `fairchem.core.datasets`.","error":"ImportError: cannot import name 'OC20Dataset' from 'fairchem.core.data'"},{"fix":"Run `pip install fairchem-core` and ensure you are using the correct Python interpreter.","cause":"`fairchem-core` is not installed, or is installed in a different Python environment.","error":"ModuleNotFoundError: No module named 'fairchem'"},{"fix":"Move model and data to GPU: `model = model.cuda(); data = {k: v.cuda() for k, v in batch.items()}`.","cause":"Model expects a CUDA tensor, but data was loaded on CPU.","error":"RuntimeError: Expected tensor to be on GPU, but found tensor on CPU"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}