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

RuntimeError: CUDA error: device-side assert triggered #6

Closed
p-null opened this issue Aug 31, 2019 · 2 comments
Closed

RuntimeError: CUDA error: device-side assert triggered #6

p-null opened this issue Aug 31, 2019 · 2 comments

Comments

@p-null
Copy link

p-null commented Aug 31, 2019

Hi, I googled this error but didn't help solve this error.

Traceback (most recent call last):
  File "/root/pytorchfm/examples/main.py", line 157, in <module>
    args.save_dir)
  File "/root/pytorchfm/examples/main.py", line 127, in main
    train(model, optimizer, train_data_loader, criterion, device)
  File "/root/pytorchfm/examples/main.py", line 81, in train
    y = model(fields)
  File "/root/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/root/pytorchfm/torchfm/model/xdfm.py", line 27, in forward
    x = self.linear(x) + self.cin(embed_x) + self.mlp(embed_x.view(-1, self.embed_output_dim))
  File "/root/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/root/pytorchfm/torchfm/layer.py", line 232, in forward
    x = F.relu(self.conv_layers[i](x))
  File "/root/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py", line 943, in relu
    result = torch.relu(input)
RuntimeError: CUDA error: device-side assert triggered

Can you take a look at it? Thank you!

@Drone-Banks
Copy link
Contributor

If you use the MovieLens dataset, the ID begins from 1, so you should change all the embedding codes

# origin:
torch.nn.Embedding(sum(field_dims), ....)
# now:
torch.nn.Embedding(sum(field_dims)+1, ...)

@p-null
Copy link
Author

p-null commented Sep 1, 2019

If you use the MovieLens dataset, the ID begins from 1, so you should change all the embedding codes

# origin:
torch.nn.Embedding(sum(field_dims), ....)
# now:
torch.nn.Embedding(sum(field_dims)+1, ...)

Resolved.
Thank you SO MUCH!

@p-null p-null closed this as completed Sep 1, 2019
rixwew added a commit that referenced this issue Sep 13, 2019
fix invalid args in demo script
reformat codes
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

2 participants