Skip to content
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

Error #2

Open
Jasmine302 opened this issue Oct 10, 2023 · 5 comments
Open

Error #2

Jasmine302 opened this issue Oct 10, 2023 · 5 comments

Comments

@Jasmine302
Copy link

I'm getting this error on the hotel dataset when reproducing your code
Traceback (most recent call last):
File "train.py", line 201, in
main()
File "train.py", line 181, in main
train(epoch)
File "train.py", line 106, in train
V_init, V_pred, V_refi, valid_mask = model(S_obs, S_trgt)
File "/home/jnu/xxq/Social-STGCNN-master/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jnu/xxq/GraphTERN-main/graphtern/model.py", line 129, in forward
mix = Categorical(torch.nn.functional.softmax(temp[:, :, :, 4], dim=-1))
File "/home/jnu/xxq/Social-STGCNN-master/venv/lib/python3.8/site-packages/torch/distributions/categorical.py", line 66, in init
super(Categorical, self).init(batch_shape, validate_args=validate_args)
File "/home/jnu/xxq/Social-STGCNN-master/venv/lib/python3.8/site-packages/torch/distributions/distribution.py", line 56, in init
raise ValueError(
ValueError: Expected parameter probs (Tensor of shape (1, 25, 8)) of distribution Categorical(probs: torch.Size([1, 25, 8])) to satisfy the constraint Simplex(), but found invalid values:
tensor([[[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan],
[nan, nan, nan, nan, nan, nan, nan, nan]]], device='cuda:0',
grad_fn=)
Have you encountered?

@InhwanBae
Copy link
Owner

Hi @Jasmine302, Your error seems to be the same as the one I noticed when I recently reran the source code. As mentioned in
issue#1, it might help to use PyTorch version 11.1 or below, or to try another seed.

The method of the torch.distributions.log_prob() operation for probability distribution in the latest version of PyTorch has changed, which seems to cause problems with loss backpropagation. If any other issues arise, let me know!

@Jasmine302
Copy link
Author

Hi @Jasmine302, Your error seems to be the same as the one I noticed when I recently reran the source code. As mentioned in issue#1, it might help to use PyTorch version 11.1 or below, or to try another seed.

The method of the torch.distributions.log_prob() operation for probability distribution in the latest version of PyTorch has changed, which seems to cause problems with loss backpropagation. If any other issues arise, let me know!

I changed the pytorch version and commented out the seeds as you did, and it's fixed, thanks a lot!

@3123155028
Copy link

Hi @Jasmine302, Your error seems to be the same as the one I noticed when I recently reran the source code. As mentioned in issue#1, it might help to use PyTorch version 11.1 or below, or to try another seed.
The method of the torch.distributions.log_prob() operation for probability distribution in the latest version of PyTorch has changed, which seems to cause problems with loss backpropagation. If any other issues arise, let me know!

I changed the pytorch version and commented out the seeds as you did, and it's fixed, thanks a lot!

hello,what's your torch and python vision

@Jasmine302
Copy link
Author

Hi @Jasmine302, Your error seems to be the same as the one I noticed when I recently reran the source code. As mentioned in issue#1, it might help to use PyTorch version 11.1 or below, or to try another seed.
The method of the operation for probability distribution in the latest version of PyTorch has changed, which seems to cause problems with loss backpropagation. If any other issues arise, let me know!torch.distributions.log_prob()

I changed the pytorch version and commented out the seeds as you did, and it's fixed, thanks a lot!

hello,what's your torch and python vision

pytorch 1.10.1 ;python 3.7.0

@3123155028
Copy link

Hi @Jasmine302, Your error seems to be the same as the one I noticed when I recently reran the source code. As mentioned in issue#1, it might help to use PyTorch version 11.1 or below, or to try another seed.
The method of the operation for probability distribution in the latest version of PyTorch has changed, which seems to cause problems with loss backpropagation. If any other issues arise, let me know!torch.distributions.log_prob()

I changed the pytorch version and commented out the seeds as you did, and it's fixed, thanks a lot!

hello,what's your torch and python vision

pytorch 1.10.1 ;python 3.7.0

thank you! AND what your seed?i change many torch vesion on my dataset(sdd),it always generates error,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants