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 occurs when model predicted #5

Open
yzj19870824 opened this issue Jul 1, 2021 · 1 comment
Open

error occurs when model predicted #5

yzj19870824 opened this issue Jul 1, 2021 · 1 comment

Comments

@yzj19870824
Copy link

When I execute command —— !cd coper-master/CoPER_MINERVA/ && bash ./experiment.sh configs/umls.sh --inference 0
error occurs:
Memory allocated before eval data loading: 1.02944768
HIIIII
652 triples loaded from data/umls/dev.triples
661 triples loaded from data/umls/test.triples
Memory allocated after eval data loading: 1.02944768
0% 0/326 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/coper-master/CoPER_MINERVA/src/experiments.py", line 830, in
run_experiment(args)
File "/content/coper-master/CoPER_MINERVA/src/experiments.py", line 813, in run_experiment
inference(lf)
File "/content/coper-master/CoPER_MINERVA/src/experiments.py", line 369, in inference
pred_scores = lf.forward(dev_data, verbose=False)
File "/content/coper-master/CoPER_MINERVA/src/learn_framework.py", line 253, in forward
pred_score = self.predict(mini_batch, verbose=verbose)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pg.py", line 226, in predict
pn, e1, r, e2, kg, self.num_rollout_steps, self.beam_size)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/beam_search.py", line 168, in beam_search
pn.update_path(action, kg, offset=action_offset)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pn.py", line 257, in update_path
offset_path_history(self.path, offset)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pn.py", line 235, in offset_path_history
new_tuple = tuple([_x[offset, :, :] for _x in x])
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pn.py", line 235, in
new_tuple = tuple([_x[offset, :, :] for _x in x])
IndexError: tensors used as indices must be long, byte or bool tensors

type of elements in offset is float, how can I solve it, anyone can help

@otiliastr
Copy link
Owner

Hi,

I will try to reproduce your error. Could you please tell me what system and version of Tensorflow you are using?

Thanks,
Otilia

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