GithubHelp home page GithubHelp logo

diffcsp's People

Contributors

jiaor17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

diffcsp's Issues

Environment variable 'HYDRA_JOBS' not found

hello! i get an error when i run——python diffcsp/run.py data=perov_5 expname=reproduction_diffcsp_perov

diffcsp/run.py:172: UserWarning:
The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
@hydra.main(config_path=str(PROJECT_ROOT / "conf"), config_name="default")
/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/defaults_list.py:251: UserWarning: In 'default': Defaults list is missing _self_. See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/default_composition_order for more information
warnings.warn(msg, UserWarning)
An error occurred during Hydra's exception formatting:
AssertionError()
Traceback (most recent call last):
File "diffcsp/run.py", line 178, in
main()
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/main.py", line 94, in decorated_main
_run_hydra(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
_run_app(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/utils.py", line 457, in _run_app
run_and_report(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/utils.py", line 302, in run_and_report
raise ex
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
return func()
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/utils.py", line 458, in
lambda: hydra.run(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 119, in run
ret = run_job(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/hydra/core/utils.py", line 116, in run_job
output_dir = str(OmegaConf.select(config, job_dir_key))
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/omegaconf.py", line 682, in select
format_and_raise(node=cfg, key=key, value=None, cause=e, msg=str(e))
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/_utils.py", line 899, in format_and_raise
_raise(ex, cause)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/_utils.py", line 797, in _raise
raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/omegaconf.py", line 674, in select
return select_value(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/_impl.py", line 58, in select_value
node = select_node(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/_impl.py", line 93, in select_node
_root, _last_key, node = cfg._select_impl(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 531, in _select_impl
value = root._maybe_resolve_interpolation(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 719, in _maybe_resolve_interpolation
return self._resolve_interpolation_from_parse_tree(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 584, in _resolve_interpolation_from_parse_tree
resolved = self.resolve_parse_tree(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 769, in resolve_parse_tree
raise InterpolationResolutionError(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 764, in resolve_parse_tree
return visitor.visit(parse_tree)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/antlr4/tree/Tree.py", line 34, in visit
return tree.accept(self)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar/gen/OmegaConfGrammarParser.py", line 206, in accept
return visitor.visitConfigValue(self)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar_visitor.py", line 101, in visitConfigValue
return self.visit(ctx.getChild(0))
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/antlr4/tree/Tree.py", line 34, in visit
return tree.accept(self)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar/gen/OmegaConfGrammarParser.py", line 342, in accept
return visitor.visitText(self)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar_visitor.py", line 301, in visitText
return self._unescape(list(ctx.getChildren()))
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar_visitor.py", line 389, in _unescape
text = str(self.visitInterpolation(node))
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar_visitor.py", line 125, in visitInterpolation
return self.visit(ctx.getChild(0))
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/antlr4/tree/Tree.py", line 34, in visit
return tree.accept(self)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar/gen/OmegaConfGrammarParser.py", line 1041, in accept
return visitor.visitInterpolationResolver(self)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/grammar_visitor.py", line 179, in visitInterpolationResolver
return self.resolver_interpolation_callback(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 750, in resolver_interpolation_callback
return self._evaluate_custom_resolver(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/base.py", line 694, in _evaluate_custom_resolver
return resolver(
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/omegaconf.py", line 445, in resolver_wrapper
ret = resolver(*args, **kwargs)
File "/home/xiaoqi/miniconda3/envs/diffdock2/lib/python3.8/site-packages/omegaconf/resolvers/oc/init.py", line 38, in env
raise KeyError(f"Environment variable '{key}' not found")
omegaconf.errors.InterpolationResolutionError: KeyError raised while resolving interpolation: "Environment variable 'HYDRA_JOBS' not found"
full_key: hydra.run.dir
object_type=dict

Double-check Hydra Version

Hi authors,

Thank you for providing the code base.

I am wondering what hydra version you are using. I am getting the following exception:

  File "xxx/anaconda3/envs/Crystallization/lib/python3.7/site-packages/hydra/_internal/utils.py", line 644, in _locate
    obj = getattr(obj, part)
AttributeError: module 'diffcsp' has no attribute 'pl_data'

I tried hydra-core==1.3.2 and 1.2.0. Neither can work.

got some trouble with training a model

While i tried to follow the guide using 'python diffcsp/run.py data=mp_20 expname=test2' to train a model ,i got errors as fllow:

Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\Admin, conda\envs\dificsp1\lib\si te-packages\miltiprocess\spavn. py”, line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File “C:\Users\Admin, conda\envs\di ffcsp1\lib\site-packages\miltiprocess\spamn. py”, line 125, in _main
prepare (preparation_data)
File “C:\Users\Admin. conda\envs\diffosp1\1ib\site-packages\mil tiprocess\spamn. py”, line 236, in prepare
—fixup_main_from_path(datal’ init_main_from path’ ])
File “C:\Users\Admin. conda\envs\diffcsp1\1ib\site-packages\mil tiprocess\spamn. py”, line 287, in _fixup_main_from patl
main_content = runpy.run_path(main_path,
File “C:\Users\Admin. conda\envs\diffcsp1\lib\runpy. py”, line 264, in run_path
code, fname = _get_code_from file(run_name, path_name)
File “C:\Users\Admin. conda\envs\diffcsp1\lib\runpy. py’, line 234, in _get_code_from_file
with io. open_code(decoded_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: ’D:\xyli\DiffCSP-main\hydra\singlerun\2024-03-20\test2\ \dil
ficsp\run. py

Whats more when i tried to train the ab initio model also get the same error.

Here is my .env file:

export PROJECT_ROOT="D:\xyli\DiffCSP-main"
export HYDRA_JOBS="D:\xyli\DiffCSP-main\hydra"
export WABDB_DIR="D:\xyli\DiffCSP-main\wabdb"

Is this problem caused by the windows10 environment?

Evaluation does not work

Hello! I am trying to reproduce your results, but command

python scripts/evaluate.py --model_path <model_path>

fails with error

TypeError: The classmethod `CrystGNN_Supervise.load_from_checkpoint` cannot be called on an instance. Please call it on the class type and make sure the return value is used.

Any advice would be much appreciated!

how to train the model

Hello! I'm trying to train the CSP model, but i don't know what parameter 'expname' stands for.

why do we use only a single test batch and multiple "T_max" ranges in `optimization.py` (?)

Hello everyone, I'd have a couple of questions regarding the diffusion code related to optimization.py (see below):

def diffusion(loader, energy, uncond, step_lr, aug):
    frac_coords = []
    num_atoms = []
    atom_types = []
    lattices = []
    input_data_list = []
    batch = next(iter(loader)).to(energy.device)

    all_crystals = []

    for i in range(1,11):
        print(f'Optimize from T={i*100}')
        outputs, _ = energy.sample(batch, uncond, step_lr = step_lr, diff_ratio = i/10, aug = aug)
        all_crystals.append(outputs)

    res = {k: torch.cat([d[k].detach().cpu() for d in all_crystals], dim=0).unsqueeze(0) for k in
        ['frac_coords', 'atom_types', 'num_atoms', 'lattices']}

    lengths, angles = lattices_to_params_shape(res['lattices'])
    
    return res['frac_coords'], res['atom_types'], lengths, angles, res['num_atoms']

Q1) In my understanding, here we are using only a single batch from the test loader, so not all the structures in the test set will be optimized, but only a single batch (?) Is this the desired behavior, or am I just missing something? I would instead iterate over different batches in order to match the number of structures that I want to optimize in my test set.

Q2) Why are we using multiple time ranges (1-10) to optimize the structures? This will simply lead to having 10x the structures we wanted to optimize in the original test set. Again, is this something that is needed (to iterate over multiple Tmaxs) or can I just set a fixed single value (e.g. 1000) in order to have the exact number of structures I want to optimize?

Many thanks and best regards,

Fed

more dependencies are needed

When I clone conda environment from CDVAE and try to run this project, I find these dependencies need be added.

  • pyshtools==4.10.*
  • pyxtal==0.6.0
  • einops
    pyshtools==4.10.* should be installed first before pyxtal==0.6.0 is installed.

Question about the paper.

Thank you for the insightful work presented in the paper. I have a question which might seem trivial but is important for my understanding.

In the paper, it is mentioned that L⊤L, in equation (6), exhibits O(3) invariance, and ψFT(fj − fi) is described as having periodic translation invariance. Referring to Proposition 3, the paper asserts that the score εˆF, as defined in Equation (9), is periodic translation invariant. However, I am curious about the underlying assumptions for this claim. Specifically, is it necessary to prove that L⊤L is also periodic translation invariant to ensure εˆF?

Thank you in advance for your answer.

How can i train a model for a property optimization task?

Hello! I can not find related information of property optimization task from README and I don't find how to use property optimization from code.
what is a time-dependent property predictor E(Lt, Ft, At, t) ?
Additionally, I find that formation energy is not evaluated in the evaluation of the generation task. I am very confused about these . I would appreciate it if the author could answer my question.

Query about algorithms of sample function

Thank you for making the great repo.
I have a query regarding the implementation of the sample function in diffusion.py.

def sample(self, batch, step_lr = 1e-5):

According to the paper, Algorithm 2 outlines the process where the predictor (as seen in line 7 of Algorithm 2) precedes the corrector (lines 9-10 in Algorithm 2). However, in the sample function implementation, the corrector seems to be employed for x_t_minus_0.5 before the predictor is applied. This appears to be in contrast with the sequence described in Algorithm 2.

Could you please clarify if this implementation reflects a deliberate modification from the algorithm described in the paper, or if I might be misinterpreting the code or the algorithm?

Best,
Hyunsoo Park

hydra.errors.InstantiationException: Error locating target 'diffcsp.pl_data.datamodule.CrystDataModule', set env var HYDRA_FULL_ERROR=1 to see chained exception. full_key: data.datamodule

Thank you very much for your contribution, do you know how to fix the following error?

/data/run01/scw6cse/DiffCSP-main/diffcsp/run.py:172: UserWarning:
The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
@hydra.main(config_path=str(PROJECT_ROOT / "conf"), config_name="default")
/HOME/scw6cse/.conda/envs/py311/lib/python3.11/site-packages/hydra/_internal/defaults_list.py:251: UserWarning: In 'default': Defaults list is missing _self_. See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/default_composition_order for more information
warnings.warn(msg, UserWarning)
/HOME/scw6cse/.conda/envs/py311/lib/python3.11/site-packages/hydra/_internal/hydra.py:119: UserWarning: Future Hydra versions will no longer change working directory at job runtime by default.
See https://hydra.cc/docs/1.2/upgrades/1.1_to_1.2/changes_to_job_working_dir/ for more information.
ret = run_job(
[rank: 0] Seed set to 42
[2024-05-14 10:07:24,302][hydra.utils][INFO] - Instantiating <diffcsp.pl_data.datamodule.CrystDataModule>
Error executing job with overrides: ['data=mp_20', 'expname=mp_20_result']


run.py 178
main()

main.py 94 decorated_main
_run_hydra(

utils.py 394 _run_hydra
_run_app(

utils.py 457 _run_app
run_and_report(

utils.py 223 run_and_report
raise ex

utils.py 220 run_and_report
return func()

utils.py 458
lambda: hydra.run(

hydra.py 132 run
_ = ret.return_value

utils.py 260 return_value
raise self._return_value

utils.py 186 run_job
ret.return_value = task_function(task_cfg)

run.py 174 main
run(cfg)

run.py 93 run
datamodule: pl.LightningDataModule = hydra.utils.instantiate(

_instantiate2.py 226 instantiate
return instantiate_node(

_instantiate2.py 333 instantiate_node
target = _resolve_target(node.get(_Keys.TARGET), full_key)

_instantiate2.py 139 _resolve_target
raise InstantiationException(msg) from e

hydra.errors.InstantiationException:
Error locating target 'diffcsp.pl_data.datamodule.CrystDataModule', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: data.datamodule

Here is my environment:

aiohttp 3.9.5
aiosignal 1.3.1
antlr4-python3-runtime 4.9.3
ase 3.22.1
attrs 23.2.0
certifi 2024.2.2
charset-normalizer 3.3.2
click 8.1.7
cmake 3.29.3
colorama 0.4.6
contourpy 1.2.1
cycler 0.12.1
dill 0.3.8
docker-pycreds 0.4.0
filelock 3.14.0
fonttools 4.51.0
frozenlist 1.4.1
fsspec 2024.3.1
future 0.18.3
gitdb 4.0.11
GitPython 3.1.43
hydra-core 1.3.2
idna 3.7
Jinja2 3.1.4
joblib 1.3.2
kiwisolver 1.4.5
latexcodec 2.0.1
lightning-utilities 0.11.2
lit 18.1.4
MarkupSafe 2.1.5
matplotlib 3.8.4
monty 2023.11.3
mpmath 1.3.0
multidict 6.0.5
multiprocess 0.70.16
networkx 3.1
numpy 1.26.4
nvidia-cublas-cu11 11.10.3.66
nvidia-cuda-cupti-cu11 11.7.101
nvidia-cuda-nvrtc-cu11 11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11 8.5.0.96
nvidia-cufft-cu11 10.9.0.58
nvidia-curand-cu11 10.2.10.91
nvidia-cusolver-cu11 11.4.0.1
nvidia-cusparse-cu11 11.7.4.91
nvidia-nccl-cu11 2.14.3
nvidia-nvtx-cu11 11.7.91
omegaconf 2.3.0
p-tqdm 1.4.0
packaging 24.0
palettable 3.3.3
pandas 2.2.2
pathos 0.3.2
Pillow 10.0.1
pip 24.0
platformdirs 4.2.1
plotly 5.18.0
pox 0.3.4
ppft 1.7.6.8
pretty-errors 1.2.25
protobuf 4.25.3
psutil 5.9.6
pybtex 0.24.0
pymatgen 2023.11.12
pyparsing 3.1.2
python-dateutil 2.9.0.post0
python-dotenv 1.0.1
pytorch-lightning 2.2.4
pytz 2024.1
PyYAML 6.0.1
requests 2.31.0
ruamel.yaml 0.18.6
ruamel.yaml.clib 0.2.8
scikit-learn 1.3.2
scipy 1.13.0
sentry-sdk 2.1.1
setproctitle 1.3.3
setuptools 68.0.0
six 1.16.0
SMACT 2.5.4
smmap 5.0.1
spglib 2.1.0
sympy 1.12
tabulate 0.9.0
tenacity 8.2.3
threadpoolctl 3.2.0
torch 2.0.0
torch-cluster 1.6.3+pt20cu118
torch_geometric 2.4.0
torch-scatter 2.1.2+pt20cu118
torch-sparse 0.6.18+pt20cu118
torch-spline-conv 1.2.2+pt20cu118
torchaudio 2.0.1
torchmetrics 1.4.0
torchvision 0.15.1
tqdm 4.66.1
triton 2.0.0
typing_extensions 4.11.0
tzdata 2024.1
uncertainties 3.1.7
urllib3 2.2.1
wandb 0.17.0
wheel 0.43.0
yarl 1.9.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.