txie-93 / cdvae

An SE(3)-invariant autoencoder for generating the periodic structure of materials [ICLR 2022]
MIT License
242 stars 94 forks source link

Environment issues and some name inconsistency #2

Closed YKQ98 closed 2 years ago

YKQ98 commented 2 years ago

Dear authors,

Hi, when I install the environment by running 'conda env create -f env.yml', I got stuck in the 'solving environment' step of conda.

Could you check this step? I think something might be wrong here ~.

Also, there are some errors when I run the training code. Some places you name it cdvae but you use crystalvae to refer it in the pipeline.

txie-93 commented 2 years ago

Thanks for reaching out @YKQ98

For the first question, it seems the step 'solving environment' is taking a very long time. But I was able to successfully install the conda packages after waiting several hours. I don't know why it takes so long to solve the environment though..

For the crystvae, these are some leftovers from the refactoring and sorry about that. They should be resolved in #1. Let me know if you have more errors after pulling the latest commits.

YKQ98 commented 2 years ago

Thank you for the feedback!

Actually I manually installed all the packages needed and the code works fine.

sgbaird commented 2 years ago

Seems like a good use-case for mamba. @YKQ98 what did you run for installing the packages manually? Did you keep some of the requirements as concrete or convert them to abstract (unpinned) dependencies? I take it you probably used a two-step installation, one with conda and a second command with pip. Is that the case?

sgbaird commented 2 years ago

A more useful error message produced by mamba:

(base) PS C:\Users\sterg\Documents\GitHub\sgbaird-5DOF\cdvae> conda install -c conda-forge mamba
(base) PS C:\Users\sterg\Documents\GitHub\sgbaird-5DOF\cdvae> mamba env create -f env.yml
pkgs/main/win-64                                              No change
pytorch/noarch                                       5.4kB @   7.2kB/s  0.8s
numba/noarch                                       589.0 B @ 602.0 B/s  0.2s
pyg/win-64                                          19.0kB @  14.2kB/s  0.7s
pkgs/main/noarch                                              No change
pkgs/msys2/noarch                                             No change
pytorch/win-64                                      89.7kB @  31.2kB/s  2.9s
bioconda/noarch                                      3.5MB @   1.2MB/s  2.3s
sgbaird/win-64                                     143.0 B @  43.0 B/s  0.5s
plotly/win-64                                        1.2kB @ 332.0 B/s  1.9s
pkgs/r/noarch                                                 No change
pkgs/msys2/win-64                                             No change
pyg/noarch                                         130.0 B @  34.0 B/s  0.2snumba/win-64                                       148.9kB @  36.3kB/s  0.8sconda-forge/noarch                                   8.4MB @   2.0MB/s  4.9splotly/noarch                                        5.5kB @   1.1kB/s  1.2sbioconda/win-64                                    122.0 B @  25.0 B/s  0.8s
sgbaird/noarch                                       4.1kB @ 837.0 B/s  0.8s
pkgs/r/win-64                                                 No change
conda-forge/win-64                                  15.1MB @   2.4MB/s  7.5s

Looking for: ['ase=3.22', 'autopep8', 'cudatoolkit=10.2', 'jupyterlab', 'matminer=0.7.3', 'matplotlib', 'nglview]

Encountered problems while solving:
  - nothing provides dscribe >=0.2.9 needed by matminer-0.7.3-pyhd8ed1ab_0
sgbaird commented 2 years ago

My attempt at a manual install:

conda create -n cdvae python==3.9.*
conda activate cdvae
conda install -c pytorch -c conda-forge -c defaults -c pyg ase autopep8 cudatoolkit jupyterlab matminer matplotlib nglview pip pyg ipywidgets pylint pymatgen pytorch-lightning pytorch seaborn tqdm
pip install hydra-core hydra-joblib-launcher p-tqdm pytest python-dotenv smact streamlit wandb
pip install -e .
Exception has occurred: ImportError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
cannot import name 'LearningRateMonitor' from 'pytorch_lightning.callbacks' (/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pytorch_lightning/callbacks/__init__.py)
  File "/home/sgbaird/GitHub/sparks-baird/cdvae/cdvae/run.py", line 12, in <module>
    from pytorch_lightning.callbacks import (
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 197, in _run_module_as_main (Current frame)
    return _run_code(code, main_globals, None,

Also tried https://github.com/PyTorchLightning/pytorch-lightning/issues/7110#issuecomment-907967384:

pip install hydra-core --upgrade
Requirement already satisfied: hydra-core in /home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages (1.2.0)
Requirement already satisfied: antlr4-python3-runtime==4.9.* in /home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages (from hydra-core) (4.9.3)
Requirement already satisfied: omegaconf~=2.2 in /home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages (from hydra-core) (2.2.2)
Requirement already satisfied: packaging in /home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages (from hydra-core) (21.3)
Requirement already satisfied: PyYAML>=5.1.0 in /home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages (from omegaconf~=2.2->hydra-core) (6.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages (from packaging->hydra-core) (3.0.9)

Same error.

Tried installing with:

mamba install -c conda-forge pytorch-lightning=1.5.10
Failed via mamba, possibly due to issue with mamba and WSL (it wasn't working before with using `mamba` instead of `conda` above)
(cdvae) sgbaird@Dell-G7:~/GitHub/sparks-baird/cdvae$ mamba install -c conda-forge pytorch-lightning=1.5.10 __ __ __ __ / \ / \ / \ / \ / \/ \/ \/ \ ███████████████/ /██/ /██/ /██/ /████████████████████████ / / \ / \ / \ / \ \____ / / \_/ \_/ \_/ \ o \__, / _/ \_____/ ` |/ ███╗ ███╗ █████╗ ███╗ ███╗██████╗ █████╗ ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗ ██╔████╔██║███████║██╔████╔██║██████╔╝███████║ ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║ ██║ ╚═╝ ██║██║ ██║██║ ╚═╝ ██║██████╔╝██║ ██║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ mamba (0.24.0) supported by @QuantStack GitHub: https://github.com/mamba-org/mamba Twitter: https://twitter.com/QuantStack █████████████████████████████████████████████████████████████ Looking for: ['pytorch-lightning=1.5.10'] pkgs/r/linux-64 No change pkgs/r/noarch No change pkgs/main/noarch No change pkgs/main/linux-64 No change conda-forge/noarch @ 1.5MB/s 5.8s conda-forge/linux-64 @ 2.4MB/s 11.7s Pinned packages: - python 3.9.* Transaction Prefix: /home/sgbaird/miniconda3/envs/cdvae Updating specs: - pytorch-lightning=1.5.10 - ca-certificates - certifi - openssl Package Version Build Channel Size ───────────────────────────────────────────────────────────────────────────────────── Install: ───────────────────────────────────────────────────────────────────────────────────── + fsspec 2022.5.0 pyhd8ed1ab_0 conda-forge/noarch 98kB + pydeprecate 0.3.2 pyhd8ed1ab_0 conda-forge/noarch 13kB + torchmetrics 0.9.1 pyhd8ed1ab_0 conda-forge/noarch 200kB Upgrade: ───────────────────────────────────────────────────────────────────────────────────── - ca-certificates 2022.4.26 h06a4308_0 pkgs/main + ca-certificates 2022.5.18.1 ha878542_0 conda-forge/linux-64 Cached - pytorch-lightning 0.8.5 py_0 conda-forge + pytorch-lightning 1.5.10 pyhd8ed1ab_0 conda-forge/noarch 308kB Downgrade: ───────────────────────────────────────────────────────────────────────────────────── - setuptools 61.2.0 py39h06a4308_0 pkgs/main + setuptools 59.5.0 py39hf3d152e_0 conda-forge/linux-64 1MB Summary: Install: 3 packages Upgrade: 2 packages Downgrade: 1 packages Total download: 2MB ───────────────────────────────────────────────────────────────────────────────────── Confirm changes: [Y/n] Y # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/home/sgbaird/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1114, in __call__ return func(*args, **kwargs) File "/home/sgbaird/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 935, in exception_converter raise e File "/home/sgbaird/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 929, in exception_converter exit_code = _wrapped_main(*args, **kwargs) File "/home/sgbaird/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 887, in _wrapped_main result = do_call(args, p) File "/home/sgbaird/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 750, in do_call exit_code = install(args, parser, "install") File "/home/sgbaird/miniconda3/lib/python3.9/site-packages/mamba/mamba.py", line 586, in install transaction.fetch_extract_packages() RuntimeError: Download error (28) Timeout was reached [https://conda.anaconda.org/conda-forge/linux-64/setuptools-59.5.0-py39hf3d152e_0.tar.bz2] Connection timeout after 9064 ms `$ /home/sgbaird/miniconda3/condabin/mamba install -c conda-forge pytorch-lightning=1.5.10` environment variables: CIO_TEST= CONDA_DEFAULT_ENV=cdvae CONDA_EXE=/home/sgbaird/miniconda3/bin/conda CONDA_MKL_INTERFACE_LAYER_BACKUP= CONDA_PREFIX=/home/sgbaird/miniconda3/envs/cdvae CONDA_PREFIX_1=/home/sgbaird/miniconda3 CONDA_PROMPT_MODIFIER=(cdvae) CONDA_PYTHON_EXE=/home/sgbaird/miniconda3/bin/python CONDA_ROOT=/home/sgbaird/miniconda3 CONDA_SHLVL=2 CURL_CA_BUNDLE= PATH=/home/sgbaird/.vscode- server/bin/4af164ea3a06f701fe3e89a2bcbb421d2026b68f/bin/remote-cli:/ho me/sgbaird/.local/bin:/home/sgbaird/miniconda3/envs/cdvae/bin:/home/sg baird/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/us r/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/P ython310/Scripts:/mnt/c/Python310:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/libnvvp:/mnt/c/Windows/system32:/mnt/c/Wi ndows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowe rShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files/MATLAB/R2021a/runtime/win64:/mnt/c/Program Files/MATLAB/R2021a/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/PuTTY:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/NVIDIA Corporation/Nsight Compute 2020.3.1:/mnt/c/WINDOWS/system32:/mnt/c/WIN DOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPower Shell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program Files/P403n1x87/Austin:/mnt/c/Program Files/dotnet:/mnt/c/Program Files/Wolfram Research/WolframScript:/mnt/c/Program Files/nodejs:/mnt/ c/Ruby31-x64/bin:/mnt/c/Users/sterg/AppData/Local/Programs/Python/Pyth on38/Scripts:/mnt/c/Users/sterg/AppData/Local/Programs/Python/Python38 :/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/ mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/ OpenSSH:/mnt/c/Program Files/Wolfram Research/WolframScript:/mnt/c/Program Files/MATLAB/R2021a/runtime/win64:/mnt/c/Program Files/MATLAB/R2021a/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/ster g/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/sterg/AppData/Local /atom/bin:/mnt/c/Users/sterg/AppData/Local/GitHubDesktop/bin:/mnt/c/Fu llProf_Suite:/mnt/c/texlive/2021/bin/win32:/mnt/c/Users/sterg/AppData/ Local/Pandoc:/mnt/c/Users/sterg/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Program Files/Graphviz/bin:/mnt/c/Users/sterg/AppData/ Local/Microsoft/WindowsApps:/mnt/c/Users/sterg/AppData/Local/Packages/ PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0/LocalCache/local-pac kages/Python39/Scripts:/mnt/c/Users/sterg/AppData/Roaming/Python/Scrip ts:/mnt/c/Users/sterg/Miniconda3:/mnt/c/Users/sterg/Miniconda3/scripts :/mnt/c/Users/sterg/Miniconda3/Library/bin:/mnt/c/Users/sterg/AppData/ Roaming/npm:/snap/bin REQUESTS_CA_BUNDLE= SSL_CERT_FILE= active environment : cdvae active env location : /home/sgbaird/miniconda3/envs/cdvae shell level : 2 user config file : /home/sgbaird/.condarc populated config files : conda version : 4.13.0 conda-build version : not installed python version : 3.9.5.final.0 virtual packages : __linux=5.10.16.3=0 __glibc=2.31=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/sgbaird/miniconda3 (writable) conda av data dir : /home/sgbaird/miniconda3/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/sgbaird/miniconda3/pkgs /home/sgbaird/.conda/pkgs envs directories : /home/sgbaird/miniconda3/envs /home/sgbaird/.conda/envs platform : linux-64 user-agent : conda/4.13.0 requests/2.27.1 CPython/3.9.5 Linux/5.10.16.3-microsoft-standard-WSL2 ubuntu/20.04.2 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False An unexpected error has occurred. Conda has prepared the above report.

Trying:

conda install -c conda-forge pytorch-lightning=1.5.10

and it took maybe a few minutes to solve. It seems to be loading the CIF files now. (~30 min to load ~30k CIF files from string representation, so saving the pymatgen Structure objects directly would probably save some time, maybe not much compared to the time it takes to train though).

sgbaird commented 2 years ago

So, first making sure that I'm actually in the WSL storage, the following seems to work:

git clone https://github.com/txie-93/cdvae.git
cd cdvae
conda create -n cdvae python==3.9.*
conda activate cdvae
conda install -c pytorch -c conda-forge -c defaults -c pyg ase autopep8 cudatoolkit jupyterlab matminer matplotlib nglview pip pyg ipywidgets pylint pymatgen pytorch-lightning=1.5.10 pytorch seaborn tqdm
pip install hydra-core hydra-joblib-launcher p-tqdm pytest python-dotenv smact streamlit wandb
pip install -e .
(cdvae) sgbaird@Dell-G7:~/cdvae$  /usr/bin/env /home/sgbaird/miniconda3/envs/cdvae/bin/python /home/sgbaird/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/lib/python/debugpy/launcher 38901 -- /home/sgbaird/cdvae/cdvae/run.py data=mp_20 expname=mp_20 
/home/sgbaird/cdvae/cdvae/run.py:164: 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/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/defaults_list.py:251: UserWarning: In 'default': Defaults list is missing `_self_`. See https://hydra.cc/docs/upgrades/1.0_to_1.1/default_composition_order for more information
  warnings.warn(msg, UserWarning)
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/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/next/upgrades/1.1_to_1.2/changes_to_job_working_dir/ for more information.
  ret = run_job(
[2022-06-11 20:18:18,133][hydra.utils][INFO] - Instantiating <cdvae.pl_data.datamodule.CrystDataModule>
/home/sgbaird/cdvae/cdvae/pl_data/datamodule.py:142: 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/sgbaird/cdvae/cdvae/pl_data/dataset.py:126: 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")
  0%|                               | 0/27136 [00:00<?, ?it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                     | 3/27136 [00:01<2:54:47,  2.59it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                     | 4/27136 [00:02<5:21:44,  1.41it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                    | 12/27136 [00:03<1:03:16,  7.14it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                      | 34/27136 [00:04<27:10, 16.62it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                      | 36/27136 [00:04<34:19, 13.16it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                      | 46/27136 [00:05<28:25, 15.89it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                      | 81/27136 [00:08<32:59, 13.66it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                      | 87/27136 [00:08<30:14, 14.90it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  0%|                     | 105/27136 [00:09<33:58, 13.26it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|                     | 159/27136 [00:13<21:29, 20.92it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 162/27136 [00:13<28:57, 15.52it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 174/27136 [00:14<41:24, 10.85it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 212/27136 [00:17<28:48, 15.58it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 227/27136 [00:18<35:59, 12.46it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 229/27136 [00:18<39:41, 11.30it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 277/27136 [00:22<32:34, 13.74it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 295/27136 [00:23<30:01, 14.90it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▏                    | 297/27136 [00:23<51:32,  8.68it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  1%|▎                    | 326/27136 [00:26<34:33, 12.93it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  2%|▍                    | 486/27136 [00:36<36:04, 12.31it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  2%|▍                    | 495/27136 [00:37<27:35, 16.09it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  2%|▍                    | 528/27136 [00:39<23:18, 19.02it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  3%|▌                    | 687/27136 [00:51<28:03, 15.71it/s]/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/pymatgen/io/cif.py:1155: UserWarning: Issues encountered while parsing CIF: Some fractional coordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: " + "\n".join(self.warnings))
  8%|█▌                  | 2073/27136 [02:34<45:23,  9.20it/s]

I'm running this in debugging mode with VS Code.

My .env file:

export PROJECT_ROOT="/home/sgbaird/cdvae"
export HYDRA_JOBS="/home/sgbaird/hydra"
export WABDB_DIR="/home/sgbaird/wabdb"

and just in case, also set it in a custom launch file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "CDVAE MP-20",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false,
            "args": [
                "data=mp_20",
                "expname=mp_20"
            ],
            "env": {
                "PROJECT_ROOT": "/home/sgbaird/cdvae",
                "HYDRA_JOBS": "/home/sgbaird/hydra",
                "WABDB_DIR": "/home/sgbaird/wabdb"
            }
        }
    ]
}
sgbaird commented 2 years ago

Still ran into an error eventually:

Exception has occurred: InstantiationException       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
Error in call to target 'cdvae.pl_modules.model.CDVAE':
InstantiationException("Error in call to target 'cdvae.pl_modules.gnn.DimeNetPlusPlusWrap':\nRuntimeError('a leaf Variable that requires grad is being used in an in-place operation.')\nfull_key: encoder")
full_key: model
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 92, in _call_target
    return _target_(*args, **kwargs)
  File "/home/sgbaird/cdvae/cdvae/pl_modules/gnn.py", line 327, in __init__
    super(DimeNetPlusPlusWrap, self).__init__(
  File "/home/sgbaird/cdvae/cdvae/pl_modules/gnn.py", line 223, in __init__
    self.rbf = BesselBasisLayer(num_radial, cutoff, envelope_exponent)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/torch_geometric/nn/models/dimenet.py", line 59, in __init__
    self.reset_parameters()
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/torch_geometric/nn/models/dimenet.py", line 62, in reset_parameters
    torch.arange(1, self.freq.numel() + 1, out=self.freq).mul_(PI)

The above exception was the direct cause of the following exception:

  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 92, in _call_target
    return _target_(*args, **kwargs)
  File "/home/sgbaird/cdvae/cdvae/pl_modules/model.py", line 140, in __init__
    self.encoder = hydra.utils.instantiate(
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 222, in instantiate
    return instantiate_node(
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 339, in instantiate_node
    return _call_target(_target_, partial, args, kwargs, full_key)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 97, in _call_target
    raise InstantiationException(msg) from e

The above exception was the direct cause of the following exception:

  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 97, in _call_target
    raise InstantiationException(msg) from e
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 339, in instantiate_node
    return _call_target(_target_, partial, args, kwargs, full_key)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 222, in instantiate
    return instantiate_node(
  File "/home/sgbaird/cdvae/cdvae/run.py", line 94, in run
    model: pl.LightningModule = hydra.utils.instantiate(
  File "/home/sgbaird/cdvae/cdvae/run.py", line 166, in main
    run(cfg)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/core/utils.py", line 186, in run_job
    ret.return_value = task_function(task_cfg)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/core/utils.py", line 260, in return_value
    raise self._return_value
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/hydra.py", line 132, in run
    _ = ret.return_value
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/utils.py", line 453, in <lambda>
    lambda: hydra.run(
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/utils.py", line 216, in run_and_report
    raise ex
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/utils.py", line 216, in run_and_report
    raise ex
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/utils.py", line 452, in _run_app
    run_and_report(
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/_internal/utils.py", line 389, in _run_hydra
    _run_app(
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/site-packages/hydra/main.py", line 90, in decorated_main
    _run_hydra(
  File "/home/sgbaird/cdvae/cdvae/run.py", line 170, in <module>
    main()
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/sgbaird/miniconda3/envs/cdvae/lib/python3.9/runpy.py", line 197, in _run_module_as_main (Current frame)
    return _run_code(code, main_globals, None,

Seems related: https://discuss.pytorch.org/t/leaf-variable-was-used-in-an-inplace-operation/308

Not sure if there are notifications on the closed issue: @YKQ98 @txie-93 @YKQ98 might be worth opening back up, otherwise I can open a fresh issue, too.