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

an Assertion error in step 3 get_pred_Hamiltonian of Inference part #41

Closed
JTaozhang opened this issue May 18, 2023 · 4 comments
Closed

Comments

@JTaozhang
Copy link

Hi, There,

When I successfully get the training model and olp matrix, I did the inference part and I meet a error like this:

=> load best checkpoint (epoch 5969)
=> Atomic types: [52, 74], spinful: True, the number of atomic types: 2.
Load processed graph from /share/home/zhangtao/work/xxxx/xxxx/work_dir/inference/graph.pkl
Traceback (most recent call last):
File "/share/home/zhangtao/anaconda3/envs/ZT-py39/bin/deeph-inference", line 8, in
sys.exit(main())
File "/share/home/zhangtao/anaconda3/envs/ZT-py39/lib/python3.9/site-packages/deeph/scripts/inference.py", line 105, in main
predict(input_dir=work_dir, output_dir=work_dir, disable_cuda=disable_cuda, device=device,
File "/share/home/zhangtao/anaconda3/envs/ZT-py39/lib/python3.9/site-packages/deeph/inference/pred_ham.py", line 167, in predict assert np.all(np.isnan(hamiltonian) == False)
AssertionError
here I also list the inference.ini setting:
[basic]
OLP_dir = /share/home/zhangtao/work/WTe2/train/data/WTe2/work_dir/olp
work_dir = /share/home/zhangtao/work/WTe2/train/data/WTe2/work_dir/inference
interface = openmx
structure_file_name = POSCAR
task = [1, 2, 3, 4, 5]
sparse_calc_config = /share/home/zhangtao/work/WTe2/train/data/WTe2/work_dir/inference/band.json
trained_model_dir = /share/home/zhangtao/work/WTe2/train/data/WTe2/work_dir/trained_model
restore_blocks_py = True
dense_calc = True
disable_cuda = False
device = cuda:0
huge_structure = True

[interpreter]
julia_interpreter = /share/home/zhangtao/software/julia-1.6.6/bin/julia

[graph]
radius = 9.0
create_from_DFT = True

band setting:
{
"calc_job": "band",
"which_k": 0,
"fermi_level": 0,
"lowest_band": -10.3,
"max_iter": 300,
"num_band": 100,
"k_data": ["20 0.5000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 X Γ", "20 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.5000000000 0.0000000000 Γ Y", "20 0.0000000000 0.5000000000 0.0000000000 0.5000000000 0.5000000000 0.0000000000 Y M","20 0.5000000000 0.5000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 M Γ"]
}
I have tried to find out reason, but I failed. So sad! I would greatly appreciate your kind help, if you could give me some advice on this error.

Best regards,
Tao

@mzjb
Copy link
Owner

mzjb commented May 18, 2023

This assert is used to check if your trained DeepH models include all possible orbital combinations. Please review the orbital parameters in your training ini settings to identify which orbitals are missing.

@JTaozhang
Copy link
Author

Hi,
Many thanks for your quick reply. I checked the orbital basis that I used for training. It looks like the orbital basis is not right. If my orbital basis setting is Te7.0-s3p2d2f1, The number of orbital basis would be 31+23+52+71=26, right? Becase I used the python code (get_all_orbital_str.py) to produce the orbital parameter. The code needs we input the number of orbital basis.
Another question is whether the orbital number would increase the training time a lot if I use the same other parameters.

best regards,
Tao

@mzjb
Copy link
Owner

mzjb commented May 18, 2023

Yes, the number of orbits for this element is 26. Increasing the number of orbits will increase the training time per epoch, but not significantly.

Alternatively, you can choose to train a new model with only the additional orbits that the old model lacks. Then, when running deeph-inference, you can specify the trained_model_dir parameter in the configuration file to include both your new model and the old model.

@JTaozhang
Copy link
Author

ok, many thanks for your help.

@mzjb mzjb closed this as completed Jun 6, 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