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

Error When Executing the code from instructions #2

Open
Harshitasahni opened this issue Aug 3, 2023 · 2 comments
Open

Error When Executing the code from instructions #2

Harshitasahni opened this issue Aug 3, 2023 · 2 comments

Comments

@Harshitasahni
Copy link

Sampling geometries

Traceback (most recent call last):
File "inference.py", line 275, in
run_cv(params)
File "inference.py", line 178, in run_cv
gen_xyzs = sample_ic_backmap(testloader, device, model, atomic_nums, n_cgs, info_dict=info_dict)
File "/users/hsahni/data_genz/GenZProt/scripts/sampling.py", line 505, in sample_ic_backmap
for batch in loader:
File "/users/hsahni/.conda/envs/genzprot_new/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 681, in next
data = self._next_data()
File "/users/hsahni/.conda/envs/genzprot_new/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 721, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/users/hsahni/.conda/envs/genzprot_new/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
return self.collate_fn(data)
File "/users/hsahni/data_genz/GenZProt/scripts/../GenZProt/data.py", line 224, in CG_collate_inf
cumulative_atoms = np.cumsum([0] + [d['num_atoms'] for d in dicts])[:-1]
File "<array_function internals>", line 200, in cumsum
File "/users/hsahni/.conda/envs/genzprot_new/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 2597, in cumsum
return _wrapfunc(a, 'cumsum', axis=axis, dtype=dtype, out=out)
File "/users/hsahni/.conda/envs/genzprot_new/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 54, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "/users/hsahni/.conda/envs/genzprot_new/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 43, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

@SoojungYang
Copy link
Contributor

Hi Harshitasahni, thank you for your interest in using our code. Could you provide us with your input files (both all atom topology file (${top_path}) and coarse-grained pdb file ($ca_trace_path)) so that we can look into the issue?

@lfkrapp
Copy link

lfkrapp commented Jun 13, 2024

Following the example from "Backmapping C_alpha traces into all-atom structures" doesn't work.

input:
python inference.py -load_model_path ../ckpt/model_seed_12345 -ca_trace_path ../data/PED00055_CA_trace.pdb -topology_path ../data/PED00055.pdb

output:
Sampling Task
traj has 1 chains
generate mask: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 85/85 [00:00<00:00, 5233.80it/s]
building CG nbr list: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 55/55 [00:00<00:00, 2496.37it/s]
finished creating dataset
model loaded successfully
Sampling geometries
0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/scripts/inference.py", line 349, in
run_cv(params)
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/scripts/inference.py", line 242, in run_cv
gen_xyzs = sample_ic_backmap(
^^^^^^^^^^^^^^^^^^
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/scripts/sampling.py", line 625, in sample_ic_backmap
for batch in loader:
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/tqdm/std.py", line 1181, in iter
for obj in iterable:
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 631, in next
data = self._next_data()
^^^^^^^^^^^^^^^^^
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 675, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
return self.collate_fn(data)
^^^^^^^^^^^^^^^^^^^^^
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/GenZProt-0.1-py3.12.egg/GenZProt/data.py", line 224, in CG_collate_inf
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/numpy/core/fromnumeric.py", line 2586, in cumsum
return _wrapfunc(a, 'cumsum', axis=axis, dtype=dtype, out=out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/khaos/syncfolder/phd/projects/mdapi/opt/GenZProt/.venv/lib/python3.12/site-packages/numpy/core/fromnumeric.py", line 45, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (56,) + inhomogeneous part.

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

3 participants