-
Notifications
You must be signed in to change notification settings - Fork 77
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
tensors used as indices must be long, byte or bool tensors #30
Comments
The type of elements in offset is float indeed. |
search for action_beam_offset = action_ind / action_sapce_size and top_unique_beam_offset = top_unique_idx / action_sapce_size |
Which file is this line of code in? Do you mind telling me? I can't find this line of code. |
action_beam_offset = action_ind / action_sapce_size (src/rl/graph_search/beam_search.py line:62) |
Thank you for your help. I found it. Thank you |
error occurs when I train model using UMLS dataset
Epoch 2: average training loss = -0.22322563640773296 entropy = 4.2052984714508055
=> saving checkpoint to '/content/MultiHopKG-master/model/umls-point.rs.conve-xavier-n/a-200-200-3-0.001-0.1-0.0-0.95-400-0.05/checkpoint-2.tar'
0% 0/11 [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/MultiHopKG-master/src/experiments.py", line 765, in
run_experiment(args)
File "/content/MultiHopKG-master/src/experiments.py", line 746, in run_experiment
train(lf)
File "/content/MultiHopKG-master/src/experiments.py", line 235, in train
lf.run_train(train_data, dev_data)
File "/content/MultiHopKG-master/src/learn_framework.py", line 146, in run_train
dev_scores = self.forward(dev_data, verbose=False)
File "/content/MultiHopKG-master/src/learn_framework.py", line 202, in forward
pred_score = self.predict(mini_batch, verbose=verbose)
File "/content/MultiHopKG-master/src/rl/graph_search/pg.py", line 226, in predict
pn, e1, r, e2, kg, self.num_rollout_steps, self.beam_size)
File "/content/MultiHopKG-master/src/rl/graph_search/beam_search.py", line 168, in beam_search
pn.update_path(action, kg, offset=action_offset)
File "/content/MultiHopKG-master/src/rl/graph_search/pn.py", line 187, in update_path
offset_path_history(self.path, offset)
File "/content/MultiHopKG-master/src/rl/graph_search/pn.py", line 176, in offset_path_history
new_tuple = tuple([_x[:, offset, :] for _x in x])
File "/content/MultiHopKG-master/src/rl/graph_search/pn.py", line 176, in
new_tuple = tuple([_x[:, offset, :] for _x in x])
IndexError: tensors used as indices must be long, byte or bool tensors
Does anyone meet that?
The text was updated successfully, but these errors were encountered: