You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[*] Loading model from pretrained/tsp_20/epoch-99.pt
0%| | 0/10 [00:00<?, ?it/s]
Traceback (most recent call last):
File "eval.py", line 216, in <module>
eval_dataset(dataset_path, width, opts.softmax_temperature, opts)
File "eval.py", line 70, in eval_dataset
results = _eval_dataset(model, dataset, width, softmax_temp, opts, device)
File "eval.py", line 140, in _eval_dataset
sequences, costs = model.sample_many(batch, batch_rep=batch_rep, iter_rep=iter_rep)
File "/home/thyoon/attention-learn-to-route/nets/attention_model.py", line 288, in sample_many
batch_rep, iter_rep
File "/home/thyoon/attention-learn-to-route/utils/functions.py", line 189, in sample_many
_log_p, pi = inner_func(input)
File "/home/thyoon/attention-learn-to-route/nets/attention_model.py", line 285, in <lambda>
lambda input: self._inner(*input), # Need to unpack tuple into arguments
File "/home/thyoon/attention-learn-to-route/nets/attention_model.py", line 234, in _inner
batch_size = state.ids.size(0)
File "/home/thyoon/attention-learn-to-route/problems/tsp/state_tsp.py", line 31, in __getitem__
assert torch.is_tensor(key) or isinstance(key, slice) # If tensor, idx all tensors by this tensor:
AssertionError
The text was updated successfully, but these errors were encountered:
Which version of Python are you using? I think this is related to using <3.8. Please make sure you use 3.8. Commenting out __getitem__ probably works fine as long as you're not using beam search (which requires indexing into the state array).
Command:
python3 eval.py data/tsp/tsp20_validation_seed4321.pkl --model pretrained/tsp_20 --decode_strategy greedy
Trace:
The text was updated successfully, but these errors were encountered: