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

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed #567

Closed
deleep225 opened this issue Jan 24, 2022 · 5 comments · Fixed by #572
Closed
Assignees
Labels
bug Something isn't working qe reproduced

Comments

@deleep225
Copy link

deleep225 commented Jan 24, 2022

I am able to do the dpgen process in my laptop all the four iterations for methane molecule. But when I run it in the PBS nodes I am getting the above error during the second iteration. (1, 8).

@deleep225 deleep225 changed the title ndexError: too many indices for array: array is 1-dimensional, but 2 were indexed IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed Jan 24, 2022
@AnguseZhang
Copy link
Collaborator

Please provide necessary information including the version of software and installation way, input file, running commands, error log , etc., AS DETAILED AS POSSIBLE to help locate and reproduce your problem.

@deleep225
Copy link
Author

Hi Zhang,
I used DeePMD-kit v2.0.3
dpgen Version: 0.10.3
I have installed deepmd through the conda cpu version.

here is the machine.json
{
"deepmd_version" : "2.0",
"train": [
{
"machine": {
"batch": "pbs",
"context_type": "LocalContext",
"work_path": "./tmp"
},
"resources": {
"numb_node": 1,
"numb_gpu": 0,
"partition": "all",
"time_limit": "120:0:0",
"task_per_node": 32,
"exclude_list": [],
"module_list": [],
"source_list": []
},
"command": "~/anaconda3/envs/deepmd/bin/dp"
}
],
"model_devi": [
{
"machine": {
"batch": "pbs",
"context_type": "LocalContext",
"work_path": "./tmp"
},
"resources": {
"numb_node": 1,
"numb_gpu": 0,
"partition": "all",
"time_limit": "120:0:0",
"task_per_node": 32,
"source_list": [
],
"module_list": [],
"exclude_list": [],
"envs": {
"GMX_DEEPMD_INPUT_JSON": "input.json"
}
},
"command": " /anaconda3/envs/deepmd/bin/lmp",
"group_size": 1
}
],
"fp": [
{
"machine": {
"batch": "pbs",
"context_type": "LocalContext",
"work_path": "./tmp"
},
"resources": {
"numb_node": 1,
"numb_gpu": 0,
"time_limit": "120:0:0",
"task_per_node": 32,
"partition": "cpu",
"exclude_list": [],
"source_list": [
],
"module_list": []
},
"command": "
/softwares/q-e-qe-6.3/bin/pw.x < input",
"group_size": 20

param.json

"type_map": [
"H",
"C"
],
"mass_map": [
1,
12
],
"init_data_prefix": "./CH4.init.data/",
"init_data_sys": [
"02.md/sys-0004-0001/deepmd"
],
"init_batch_size": [
8
],
"sys_configs": [
[
"./CH4.init.data/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
],
[
"./CH4.init.data/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
]
],
"sys_batch_size": [
8,
8
],
"_comment": " that's all ",
"numb_models": 4,
"train_param": "input.json",
"default_training_param": {
"model": {
"type_map": [
"H",
"C"
],
"descriptor": {
"type": "se_a",
"sel": [
16,
4
],
"rcut_smth": 0.5,
"rcut": 5.00,
"neuron": [
10,
20,
40
],
"resnet_dt": false,
"axis_neuron": 12,
"seed": 1
},
"fitting_net": {
"neuron": [
120,
120,
120
],
"resnet_dt": true,
"seed": 1
}
},
"learning_rate": {
"type": "exp",
"start_lr": 0.001,
"decay_steps": 200
},
"loss": {
"start_pref_e": 0.02,
"limit_pref_e": 2,
"start_pref_f": 1000,
"limit_pref_f": 1,
"start_pref_v": 0.0,
"limit_pref_v": 0.0
},
"training": {
"stop_batch": 40000,
"disp_file": "lcurve.out",
"disp_freq": 1000,
"numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
"_comment": "that's all"
}
},
"model_devi_dt": 0.002,
"model_devi_skip": 0,
"model_devi_f_trust_lo": 0.012,
"model_devi_f_trust_hi": 0.10,
"model_devi_clean_traj": false,
"model_devi_jobs": [
{
"sys_idx": [
0
],
"temps": [
50
],
"press": [
1
],
"trj_freq": 10,
"nsteps": 1000,
"ensemble": "nvt",
"_idx": "00"
},
{
"sys_idx": [
1
],
"temps": [
50
],
"press": [
1
],
"trj_freq": 10,
"nsteps": 3000,
"ensemble": "nvt",
"_idx": "01"
}
],
"fp_style": "pwscf",
"shuffle_poscar": false,
"fp_task_max": 30,
"fp_task_min": 5,
"fp_pp_path": "./CH4.init.data/pp/",
"fp_pp_files": [
"H.tm.pbe.UPF", "C.tm.pbe.UPF"
],

"user_fp_params": {
"_comment": "pseudo_dir will be added automatically",
"control": {
"calculation": "scf",
"restart_mode": "from_scratch",
"outdir": "./OUT",
"tprnfor": true,
"tstress": true,
"disk_io": "none"
},
"_comment": "ibrav, nat and ntyp will be added automatically",
"system": {
"ecutwfc": 110,
"ts_vdw_econv_thr": 1e-8,
"nosym": true
},
"electrons": {
"conv_thr": 1e-8
},
"kspacing": 100
},
"_comment": " that's all "
}

@deleep225
Copy link
Author

Error message

Traceback (most recent call last):
File "/home/reddy/.local/bin/dpgen", line 8, in
sys.exit(main())
File "/home/reddy/.local/lib/python3.9/site-packages/dpgen/main.py", line 175, in main
args.func(args)
File "/home/reddy/.local/lib/python3.9/site-packages/dpgen/generator/run.py", line 2997, in gen_run
run_iter (args.PARAM, args.MACHINE)
File "/home/reddy/.local/lib/python3.9/site-packages/dpgen/generator/run.py", line 2986, in run_iter
post_fp (ii, jdata)
File "/home/reddy/.local/lib/python3.9/site-packages/dpgen/generator/run.py", line 2867, in post_fp
post_fp_pwscf(iter_index, jdata)
File "/home/reddy/.local/lib/python3.9/site-packages/dpgen/generator/run.py", line 2608, in post_fp_pwscf
_sys = dpdata.LabeledSystem(oo, fmt = 'qe/pw/scf', type_map = jdata['type_map'])
File "/home/reddy/.local/lib/python3.9/site-packages/dpdata/system.py", line 883, in init
self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step, **kwargs)
File "/home/reddy/.local/lib/python3.9/site-packages/dpdata/system.py", line 120, in from_fmt
return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
File "/home/reddy/.local/lib/python3.9/site-packages/dpdata/system.py", line 890, in from_fmt_obj
data = fmtobj.from_labeled_system(file_name, **kwargs)
File "/home/reddy/.local/lib/python3.9/site-packages/dpdata/plugins/qe.py", line 42, in from_labeled_system
= dpdata.qe.scf.get_frame(file_name)
File "/home/reddy/.local/lib/python3.9/site-packages/dpdata/qe/scf.py", line 137, in get_frame
np.array(energy)[np.newaxis], force[np.newaxis, :, :], stress[np.newaxis, :, :]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

@HuangJiameng
Copy link
Collaborator

According to the IndexError reported by dpdata, maybe there's something wrong with your data set. If the problem hasn't been solved, please provide your input files to help locate and reproduce the problem.

@njzjz njzjz transferred this issue from deepmodeling/dpgen Nov 2, 2023
@njzjz njzjz added bug Something isn't working and removed awaiting response labels Nov 5, 2023
@njzjz njzjz added the qe label Nov 5, 2023
@njzjz njzjz linked a pull request Nov 5, 2023 that will close this issue
@njzjz
Copy link
Member

njzjz commented Nov 6, 2023

Fixed by #572.

@njzjz njzjz closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working qe reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants