Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure while preprocess in demo-abacus #56

Closed
yixiuzju opened this issue Sep 20, 2023 · 6 comments
Closed

failure while preprocess in demo-abacus #56

yixiuzju opened this issue Sep 20, 2023 · 6 comments

Comments

@yixiuzju
Copy link

Hello PhD.Li, I am a beginner in DeepH.
When I tried to replicate the “demo: train the DeepH model using the Abacus interface” , I encountered the failure when I run step2-preprocess, the command line display:
User config name: ['preprocess.ini']
Found 3 directories to preprocess
^MPreprocessing No. 1/3 [08:00:00<?]...Output subdirectories: OUT.ABACUS
Traceback (most recent call last):
File "/public3/home/scg8978/.conda/envs/python39/bin/deeph-preprocess", line 33, in
sys.exit(load_entry_point('deeph==0.2.2', 'console_scripts', 'deeph-preprocess')())
File "/public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/scripts/preprocess.py", line 147, in main
worker(index)
File "/public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/scripts/preprocess.py", line 118, in worker
abacus_parse(abspath, os.path.abspath(relpath), 'OUT.' + abacus_suffix)
File "/public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/preprocess/abacus_get_data.py", line 160, in abacus_parse
assert line is not None, 'Cannot find "NSPIN" in log file'
AssertionError: Cannot find "NSPIN" in log file
My preprocess.ini is
[basic]
raw_dir =./dataset_3_graphene
processed_dir =./preprocessed_3_graphene
target = hamiltonian
interface = abacus

[interpreter]
julia_interpreter = julia

[graph]
radius = -1
create_from_DFT = True
Although I have been success in master the process of deeph using the demo_abacus in the bohrium platform, I am still a beginner,I can't success in run the demo in our supercomputer, I want to ask how I can solve this problem. looking forward to your reply.
best wishes.

@mzjb
Copy link
Owner

mzjb commented Sep 20, 2023

Hi,

Please provide the OUT.ABACUS file generated by your ABACUS calculation. It should be located at ./dataset_3_graphene/xxx/OUT.ABACUS. Additionally, please let me know the version of ABACUS you are using.

@yixiuzju
Copy link
Author

Hello PhD.Li
Thanks for your reply! I have been provided the OUT.ABACUS file in 0 file by your email "[email protected]. Meanwhile, the using ABACUS version is the latest version ABACUS3.3.3.

@mzjb
Copy link
Owner

mzjb commented Sep 22, 2023

It seems that the recent update to ABACUS has caused a change in the output format, making it incompatible with the DeepH-pack. To resolve this issue temporarily, you can modify the code by following these steps:

  1. Navigate to the /public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/preprocess/abacus_get_data.py file.

  2. Delete lines 156 to 175, which contain the following content:

        if only_S:
            spinful = False
        else:
            line = find_target_line(f, "NSPIN")
            assert line is not None, 'Cannot find "NSPIN" in log file'
            if "NSPIN == 1" in line:
                spinful = False
            elif "NSPIN == 4" in line:
                spinful = True
            else:
                raise ValueError(f'{line} is not supported')

        if only_S:
            fermi_level = 0.0
        else:
            line = find_target_line(f, "EFERMI")
            assert line is not None, 'Cannot find "EFERMI" in log file'
            assert "eV" in line
            fermi_level = float(line.split()[2])
            assert find_target_line(f, "EFERMI") is None, "There is more than one EFERMI in log file"
  1. After deleting those lines, replace them with the following content:
        if only_S:
            fermi_level = 0.0
        else:
            line = find_target_line(f, "EFERMI")
            assert line is not None, 'Cannot find "EFERMI" in log file'
            assert "eV" in line
            fermi_level = float(line.split()[2])
            # assert find_target_line(f, "EFERMI") is None, "There is more than one EFERMI in log file"

        if only_S:
            spinful = False
        else:
            line = find_target_line(f, "NSPIN")
            assert line is not None, 'Cannot find "NSPIN" in log file'
            if "NSPIN == 1" in line:
                spinful = False
            elif "NSPIN == 4" in line:
                spinful = True
            else:
                raise ValueError(f'{line} is not supported')

I have tested this modification on the 0 file you provided, and it correctly parses the data.

@yixiuzju
Copy link
Author

Hello PhD.Li
Thanks for very much your detailed reply! I have been modified the code as your suggestion, but unfortunately, I encountered the same problem, the command line display as follows,I want to ask should I continue modifying the code or make changes the version of abacus,If necessary, which version of Abacus should I switch, looking forward you reply as your busy schedule.
User config name: ['preprocess.ini']
Found 3 directories to preprocess
^MPreprocessing No. 1/3 [08:00:00<?]...Output subdirectories: OUT.ABACUS
Traceback (most recent call last):
File "/public3/home/scg8978/.conda/envs/python39/bin/deeph-preprocess", line 33, in
sys.exit(load_entry_point('deeph==0.2.2', 'console_scripts', 'deeph-preprocess')())
File "/public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/scripts/preprocess.py", line 147, in main
worker(index)
File "/public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/scripts/preprocess.py", line 118, in worker
abacus_parse(abspath, os.path.abspath(relpath), 'OUT.' + abacus_suffix)
File "/public3/home/scg8978/.conda/envs/python39/lib/python3.9/site-packages/deeph/preprocess/abacus_get_data.py", line 160, in abacus_parse
assert line is not None, 'Cannot find "EFERMI" in log file'
AssertionError: Cannot find "EFERMI" in log file

@mzjb
Copy link
Owner

mzjb commented Sep 22, 2023

Please confirm which specific data corresponds to the abacus file that is causing the error, as I attempted to process the 0 file you provided without encountering any errors. To verify, please follow these steps:

  1. Delete the two folders other than 0 from the ./dataset_3_graphene directory.
  2. Run deeph-preprocess and check whether it still produces an error.

@yixiuzju
Copy link
Author

Hi PhD.Li
I successfully run deep-preprocess when I only use 0 file. when I recalculate the 1 and 2 file in the configulation using abacus , the two files also could run deep-preprocess, I guess the original 1 and 2 file calculated by abacus has some problems. Thanks for very much your help!

@mzjb mzjb closed this as completed Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants