meshed-memory-transformer icon indicating copy to clipboard operation
meshed-memory-transformer copied to clipboard

Error on testing the network on Windows 10

Open marcomameli1992 opened this issue 3 years ago • 6 comments

I'm traying to test the network on my windows 10 notebook. I configure all the packages but when the test start it gives me the next error:

Traceback (most recent call last): File "", line 1, in File "C:\Program Files\JetBrains\PyCharm 2020.2.3\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2020.2.3\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "E:/DeepLearning/Fashion/FeaturesExtraction/FashionFeaturesExtraction/captioning/meshed-memory-transformer/test.py", line 77, in scores = predict_captions(model, dict_dataloader_test, text_field) File "E:/DeepLearning/Fashion/FeaturesExtraction/FashionFeaturesExtraction/captioning/meshed-memory-transformer/test.py", line 26, in predict_captions out, _ = model.beam_search(images, 20, text_field.vocab.stoi[''], 5, out_size=1) File "E:\DeepLearning\Fashion\FeaturesExtraction\FashionFeaturesExtraction\captioning\meshed-memory-transformer\models\captioning_model.py", line 70, in beam_search return bs.apply(visual, out_size, return_probs, **kwargs) File "E:\DeepLearning\Fashion\FeaturesExtraction\FashionFeaturesExtraction\captioning\meshed-memory-transformer\models\beam_search\beam_search.py", line 71, in apply visual, outputs = self.iter(t, visual, outputs, return_probs, **kwargs) File "E:\DeepLearning\Fashion\FeaturesExtraction\FashionFeaturesExtraction\captioning\meshed-memory-transformer\models\beam_search\beam_search.py", line 121, in iter self.model.apply_to_states(self._expand_state(selected_beam, cur_beam_size)) File "E:\DeepLearning\Fashion\FeaturesExtraction\FashionFeaturesExtraction\captioning\meshed-memory-transformer\models\containers.py", line 30, in apply_to_states self._buffers[name] = fn(self._buffers[name]) File "E:\DeepLearning\Fashion\FeaturesExtraction\FashionFeaturesExtraction\captioning\meshed-memory-transformer\models\beam_search\beam_search.py", line 26, in fn s = torch.gather(s.view(*([self.b_s, cur_beam_size] + shape[1:])), 1, RuntimeError: gather_out_cuda(): Expected dtype int64 for index

marcomameli1992 avatar Jan 07 '21 14:01 marcomameli1992

@marcomameli1992 I'm facing the same issue as well. Were you able to resolve it?

TanayDeshmukh avatar Jan 13 '21 18:01 TanayDeshmukh

I have the same problem too. Does anyone know how to solve this problem? help!

Corleone-Huang avatar Feb 01 '21 08:02 Corleone-Huang

ok, I find a way to solve the problem in another issue!

Corleone-Huang avatar Feb 01 '21 08:02 Corleone-Huang

@CoreloneH care to share how you solved your problem???

osolo98 avatar May 10 '21 13:05 osolo98

hi,@osolo98 you can find the solution in issue #39. The solution is that You can modify a line of code(line 118):selected_beam = selected_idx / /candidate_logprob.shape[-1] meshed-memory-transformer/models/beam_search/beam_search.py which can address this problem.

Corleone-Huang avatar May 11 '21 09:05 Corleone-Huang

thank you @CoreloneH . got it.

osolo98 avatar May 12 '21 04:05 osolo98