Code error
AlanZhou0726 opened this issue · 3 comments
Traceback (most recent call last):
File "C:/Users/zhoug/Desktop/T2F-master/implementation/train_network.py", line 427, in
main(parse_arguments())
File "C:/Users/zhoug/Desktop/T2F-master/implementation/train_network.py", line 380, in main
device=device
TypeError: init() got an unexpected keyword argument 'embedding_size'
Could you please tell me how to deal with this ERROR?
Traceback (most recent call last):
File "train_network.py", line 431, in
main(parse_arguments())
File "train_network.py", line 425, in main
use_matching_aware_dis=config.use_matching_aware_discriminator
File "train_network.py", line 140, in train_networks
fixed_embeddings = encoder(fixed_captions)
File "C:\ProgramData\Anaconda3\envs\mainpro\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "F:\Projects\mainproj\T2F\implementation\networks\TextEncoder.py", line 42, in forward
output, (_, _) = self.network(x)
File "C:\ProgramData\Anaconda3\envs\mainpro\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\ProgramData\Anaconda3\envs\mainpro\lib\site-packages\torch\nn\modules\container.py", line 91, in forward
input = module(input)
File "C:\ProgramData\Anaconda3\envs\mainpro\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\ProgramData\Anaconda3\envs\mainpro\lib\site-packages\torch\nn\modules\sparse.py", line 110, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "C:\ProgramData\Anaconda3\envs\mainpro\lib\site-packages\torch\nn\functional.py", line 1110, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index'
==================================================================
OS: windows 10
Torch: 0.4.1
CUDA used is 9.0
Python version = 3.6
I really need your help!
Thanks!
Traceback (most recent call last):
File "C:/Users/zhoug/Desktop/T2F-master/implementation/train_network.py", line 427, in
main(parse_arguments())
File "C:/Users/zhoug/Desktop/T2F-master/implementation/train_network.py", line 380, in main
device=device
TypeError: init() got an unexpected keyword argument 'embedding_size'Could you please tell me how to deal with this ERROR?
@AlanZhou0726 Have you found a solution for this?