Skip to content

RuntimeError: Expected object of backend CUDA but got backend CPU for argument #3 'index' #13

@KaffeineCode

Description

@KaffeineCode

I am getting this error and don't know how to solve it, can you help please?

Starting the training process ...
Traceback (most recent call last):
File "train_network.py", line 426, in
main(parse_arguments())
File "train_network.py", line 420, in main
use_matching_aware_dis=config.use_matching_aware_discriminator
File "train_network.py", line 138, in train_networks
fixed_embeddings = encoder(fixed_captions)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "D:\Download\T2F-master\T2F-master\implementation\networks\TextEncoder.py", line 42, in forward
output, (_, _) = self.network(x)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\sparse.py", line 117, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "C:\Users\Giacobbe\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\functional.py", line 1506, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of backend CUDA but got backend CPU for argument #3 'index'

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