-
Notifications
You must be signed in to change notification settings - Fork 35
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
I run python train.py and get error with File "../utils/alias_multinomial.py", line 57 #2
Comments
I just tested the code and didn't get any errors. |
Thanks for your response. But I have upgrade the latest pytorch using condo -c soumith pytorch and get a new error: RuntimeError: invalid argument 1: must be >= 0 and <= 1 at /Users/soumith/miniconda2/conda-bld/pytorch_1503975723910/work/torch/lib/TH/THRandom.c:270 Because I run your code on my computer without GPU so I have to change your code by deleting anything relating to cuda(). Because I have just used pytorch, please tell me is it right? |
Hi. Have you changed any parameters in the code? |
Let's debug together. |
This is result before program raise error: |
Now try |
number of documents: 12829 epoch 1 |
Add |
Wow. A great support!!! |
Hello, thucnt |
I want to know If I want to run on CPU, is it ok if I just delete the.Cuda () in the code? |
@Oliveche I don't recommend to run this on CPU because it will be very slow. |
Thanks! I have deleted. But there is still the following problem, number of documents: 12829 epoch 1 Please help me , thank you very much. |
Traceback (most recent call last):
File "train.py", line 36, in
main()
File "train.py", line 32, in main
save_every=20, grad_clip=5.0
File "../utils/training.py", line 127, in train
neg_loss, dirichlet_loss = model(doc_indices, pivot_words, target_words)
File "/Users/macbook/anaconda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(input, **kwargs)
File "../utils/lda2vec_loss.py", line 72, in forward
neg_loss = self.neg(pivot_words, target_words, doc_vectors, w)
File "/Users/macbook/anaconda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(input, **kwargs)
File "../utils/lda2vec_loss.py", line 142, in forward
noise = self.multinomial.draw(batch_sizewindow_sizeself.num_sampled)
File "../utils/alias_multinomial.py", line 57, in draw
b = torch.bernoulli(q)
RuntimeError: invalid argument 1: must be >= 0 and <= 1 at /Volumes/OSX/Downloads/pytorch/aten/src/TH/THRandom.c:300
The text was updated successfully, but these errors were encountered: