chaitjo/graph-convnet-tsp

Error in beamsearch.py

sahilm1992 opened this issue · 6 comments

Hi,

I am getting the following error on line 96 in file Utils/beamsearch.py
On this line
self.mask = self.mask.gather(1, perm_mask)

Error is

gather_out_gpu(): expected dtype int64 for index

The issue is that perm_mask is having float values but torch.gather expects integer in the index argument

Could you please help me on this.

I used the same libraries with the version numbers recommended in the readme.

I am running for tsp10.

Hi @sahilm1992, thanks for your interest! That's unexpected, but maybe you can fix it by simply converting the float tensor to a long tensor?

E.g. self.mask = self.mask.gather(1, perm_mask.long())

Let me know if that works.

let me try that. Could you confirm if the implementation works on gpu?

Yes, all experiments in the associated paper were run using this codebase. You can read about our exact hardware setup there. However, the code has not been updated since ~ 1 year. You can try the updated repository associated with the more comprehensive paper, too.

By the way, can you tell me your hardware setup? E.g. Operating system, Cuda version, GPU type, etc.

It worked now.
Possibly some cuda issue.

Thanks :)

Great, feel free to open further issues if you need help.