Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Error using CUDA #10

@rsteca

Description

@rsteca

I get this error when trying to use the code with GPU (it works fine with CPU):

2019-05-14 19:51:48,675 - VOC_TOPICS - INFO - Shape of data: (40560, 82).
Missing in data: 0.
2019-05-14 19:51:48,785 - VOC_TOPICS - INFO - Training size: 28392.
2019-05-14 19:51:51,329 - VOC_TOPICS - INFO - Iterations per epoch: 221.812 ~ 222.
Traceback (most recent call last):
  File "main.py", line 196, in <module>
    iter_loss, epoch_loss = train(model, data, config, n_epochs=10, save_plots=save_plots)
  File "main.py", line 84, in train
    loss = train_iteration(net, t_cfg.loss_func, feats, y_history, y_target)
  File "main.py", line 143, in train_iteration
    input_weighted, input_encoded = t_net.encoder(numpy_to_tvar(X))
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/da-rnn/da-rnn/modules.py", line 43, in forward
    input_data.permute(0, 2, 1)), dim=2)  # batch_size * input_size * (2*hidden_size + T - 1)
RuntimeError: Expected object of backend CPU but got backend CUDA for sequence element 2 in sequence argument at position #1 'tensors'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions