Open sarvesh710 opened 5 years ago
Same problem here. Does anyone know why?
preprocessed data was found and loaded
Traceback (most recent call last):
File "train_word_embeddings.py", line 50, in
According to the note, if you delete following lines in selfModules/neg.py, it will work just fine. assert parameters_allocation_check(self), \ """ Invalid CUDA options. out_embed and in_embed parameters both should be stored in the same memory got out_embed.is_cuda = {}, in_embed.is_cuda = {} """.format(self.out_embed.weight.is_cuda, self.in_embed.weight.is_cuda)
According to the note, if you delete following lines in selfModules/neg.py, it will work just fine. assert parameters_allocation_check(self), """ Invalid CUDA options. out_embed and in_embed parameters both should be stored in the same memory got out_embed.is_cuda = {}, in_embed.is_cuda = {} """.format(self.out_embed.weight.is_cuda, self.in_embed.weight.is_cuda)
yeah, the code is to do 'parameters_allocation_check', i deleted them and it worked, but i dont know whether it influence the output or not.
According to the note, if you delete following lines in selfModules/neg.py, it will work just fine. assert parameters_allocation_check(self), """ Invalid CUDA options. out_embed and in_embed parameters both should be stored in the same memory got out_embed.is_cuda = {}, in_embed.is_cuda = {} """.format(self.out_embed.weight.is_cuda, self.in_embed.weight.is_cuda)
Currently working on Python 3.6.9 and facing the same issue. After removing the parameters_allocation_check code (quoted above), I faced additional errors and this is how I solved them. (P.S. line number might differ)
ValueError: 'Object arrays cannot be loaded when allow_pickle=False'
In batch_loader.py, line 221. For np.load add in the argument allow_pickle=True
, as instructed by StackOverflow post here.
[self.word_tensor, self.character_tensor] = [np.array([np.load(target, allow_pickle=True) for target in input_type])
for input_type in tensor_files]
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed In train_word_embeddings.py, line 56. For out.cpu().data.numpy()[0] remove the index [0].
if iteration % 500 == 0:
out = out.cpu().data.numpy()
print('iteration = {}, loss = {}'.format(iteration, out))
This allowed me to run the codes and build a custom word embedding successfully. Still studying the impact it has on the word embeddings so please use at your own discretion. Hope this helps the others!
File "/home/sarvesh23/pytorch_RVAE/utils/functional.py", line 6, in f_and return x and y RuntimeError: bool value of Tensor with more than one value is ambiguous
I am running train_word_embeddings.py. Any hint what I am doing wrong ?