mir-group / nequip

NequIP is a code for building E(3)-equivariant interatomic potentials
https://www.nature.com/articles/s41467-022-29939-5
MIT License
565 stars 124 forks source link

run works on colab but fails on spyder❓ [QUESTION] #352

Closed rothmic closed 12 months ago

rothmic commented 1 year ago

Hi, I am new using nequip. I was able to run examples without problem on google colab notebook. But when I try to run the same code on spyder (pip), with the same inputs, I get an error: "Failed to build object with prefix dataset using builder NpzDataset" I had tried to run the example "example.yaml" on colab and a few configurations of my own, and all worked great on colab but not in spyder. (all using npz data) I would appreciate an explanation on this issue, and a way to solve it.. Thank you!

Linux-cpp-lisp commented 12 months ago

Hi @rothmic ,

Can you please post the rest of your error message in full?

rothmic commented 12 months ago

Hi, Sure, here is the full error massege:

wandb: Tracking run with wandb version 0.15.5 wandb: Run data is saved locally in C:\Users\rothmic1\nequip\wandb\run-20230712_090834-to13x91c wandb: Run wandb offline to turn off syncing. wandb: Syncing run example-run-cc10 wandb: View project at https://wandb.ai/teamteam5/toluene-example wandb: View run at https://wandb.ai/teamteam5/toluene-example/runs/to13x91c Torch device: cpu Processing dataset... Loaded data: Batch(batch=[13500], cell=[500, 3, 3], edge_cell_shift=[226396, 3], edge_index=[2, 226396], forces=[13500, 3], pbc=[500, 3], pos=[13500, 3], ptr=[501], total_energy=[500, 1]) processed data size: ~9.40 MB Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\shutil.py", line 791, in move os.rename(src, real_dst) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\rothmic1\AppData\Local\Temp\tmp7b2kbyfr' -> 'results\cc10\processed_dataset_ed10f3155c57911f95ac812ffa6f458a9eeb9b33\.tmp-data.pth~'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 39, in _process_moves shutil.move(from_name, tmp_path) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\shutil.py", line 806, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\rothmic1\AppData\Local\Temp\tmp7b2kbyfr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\auto_init.py", line 232, in instantiate instance = builder(positional_args, final_optional_args) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 707, in init super().init( File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 166, in init super().init(root=root, type_mapper=type_mapper) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 50, in init super().init(root=root, transform=type_mapper) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\torch_geometric\dataset.py", line 91, in init self._process() File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\torch_geometric\dataset.py", line 176, in _process self.process() File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 313, in process torch.save((data, fixed_fields, self.include_frames), f) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\contextlib.py", line 120, in exit next(self.gen) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 182, in atomic_write _submit_move(Path(tp.name), Path(fname), blocking=blocking) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 128, in _submit_move _process_moves([obj]) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 43, in _process_moves _delete_files_if_exist([m[1] for m in moves]) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 25, in _delete_files_if_exist f.unlink(missing_ok=True) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\pathlib.py", line 1324, in unlink self._accessor.unlink(self) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\rothmic1\AppData\Local\Temp\tmp7b2kbyfr'

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

Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\rothmic1\AppData\Local\Programs\Python\Python38\Scripts\nequip-train.exe__main__.py", line 7, in sys.exit(main()) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\scripts\train.py", line 72, in main trainer = fresh_start(config) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\scripts\train.py", line 148, in fresh_start dataset = dataset_from_config(config, prefix="dataset") File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data_build.py", line 78, in dataset_fromconfig instance, = instantiate( File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\auto_init.py", line 234, in instantiate raise RuntimeError( RuntimeError: Failed to build object with prefix dataset using builder NpzDataset Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\shutil.py", line 791, in move os.rename(src, real_dst) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\rothmic1\AppData\Local\Temp\tmp7b2kbyfr' -> 'results\cc10\processed_dataset_ed10f3155c57911f95ac812ffa6f458a9eeb9b33\.tmp-data.pth~'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 39, in _process_moves shutil.move(from_name, tmp_path) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\shutil.py", line 806, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\rothmic1\AppData\Local\Temp\tmp7b2kbyfr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\auto_init.py", line 232, in instantiate instance = builder(positional_args, final_optional_args) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 707, in init super().init( File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 166, in init super().init(root=root, type_mapper=type_mapper) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 50, in init super().init(root=root, transform=type_mapper) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\torch_geometric\dataset.py", line 91, in init self._process() File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\torch_geometric\dataset.py", line 176, in _process self.process() File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data\dataset.py", line 313, in process torch.save((data, fixed_fields, self.include_frames), f) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\contextlib.py", line 120, in exit next(self.gen) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 182, in atomic_write _submit_move(Path(tp.name), Path(fname), blocking=blocking) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 128, in _submit_move _process_moves([obj]) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 43, in _process_moves _delete_files_if_exist([m[1] for m in moves]) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\savenload.py", line 25, in _delete_files_if_exist f.unlink(missing_ok=True) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\pathlib.py", line 1324, in unlink self._accessor.unlink(self) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\rothmic1\AppData\Local\Temp\tmp7b2kbyfr'

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

Traceback (most recent call last): File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\rothmic1\AppData\Local\Programs\Python\Python38\Scripts\nequip-train.exe__main__.py", line 7, in sys.exit(main()) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\scripts\train.py", line 72, in main trainer = fresh_start(config) File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\scripts\train.py", line 148, in fresh_start dataset = dataset_from_config(config, prefix="dataset") File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\data_build.py", line 78, in dataset_fromconfig instance, = instantiate( File "c:\users\rothmic1\appdata\local\programs\python\python38\lib\site-packages\nequip\utils\auto_init.py", line 234, in instantiate raise RuntimeError( RuntimeError: Failed to build object with prefix dataset using builder NpzDataset wandb: Waiting for W&B process to finish... (failed 1). Press Ctrl-C to abort syncing. wandb: View run example-run-cc10 at: https://wandb.ai/teamteam5/toluene-example/runs/to13x91c wandb: Synced 5 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s) wandb: Find logs at: .\wandb\run-20230712_090834-to13x91c\logs

Thank you!

Linux-cpp-lisp commented 12 months ago

See https://github.com/mir-group/nequip/issues/229.

We do not support Windows. While things may sometimes work, there are obscure filesystems issues that come up. If you absolutely need to use Windows, use Windows Subsystem for Linux, where I've managed to run NequIP in the past (though not on a machine with a GPU, I have no idea what CUDA does in that context).

rothmic commented 12 months ago

Thank you for your answer!