Traceback (most recent call last):
File "train.py", line 130, in <module>
old_val_psnr, old_val_ssim = validation(Encoder, DecGen, val_data_loader, device, category)
File "/home/chen009/Desktop/ganmethod/utils.py", line 48, in validation
latent, mu, var = Encoder(haze)
File "/home/chen009/Desktop/ganmethod/network.py", line 76, in __init__
self.mu = nn.Linear(1024, nz, bias=False)
File "/home/chen009/anaconda3/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 72, in __init__
self.weight = Parameter(torch.Tensor(out_features, in_features))
TypeError: new() received an invalid combination of arguments - got (Tensor, int), but expected one of:
* (torch.device device)
* (torch.Storage storage)
* (Tensor other)
* (tuple of ints size, torch.device device)
didn't match because some of the arguments have invalid types: (Tensor, int)
* (object data, torch.device device)
didn't match because some of the arguments have invalid types: (Tensor, int)
I am getting error on this line of code
here is the error displayed
new() received an invalid combination of arguments - got (numpy.ndarray, dtype=torch.dtype), but expected one of:
* (torch.device device)
* (torch.Storage storage)
* (Tensor other)
* (tuple of ints size, torch.device device)
didn't match because some of the keywords were incorrect: dtype
* (object data, torch.device device)
didn't match because some of the keywords were incorrect: dtype
File “C:\Users\XYZ\Anaconda3\envs\PyTorch\lib\site-packages\torch\nn\modules\linear.py”, line 72, in init
self.weight = Parameter(torch.Tensor(out_features, in_features))
TypeError: new() received an invalid combination of arguments - got (Tensor, GCN), but expected one of:
(torch.device device)
(torch.Storage storage)
(Tensor other)
(tuple of ints size, torch.device device)
didn’t match because some of the arguments have invalid types: (!Tensor!, !GCN!)
(object data, torch.device device)
didn’t match because some of the arguments have invalid types: (!Tensor!, !GCN!)