TypeError: conv3d() received an invalid combination of arguments - got (builtin_function_or_method, Parameter, Parameter, tuple, tuple, tuple, int),

username: Mhansy
cooked: <p>TypeError                                 Traceback (most recent call last)<br>
~\main.py in <br>
387         return output<br>
388 if <strong>name</strong> == ‘<strong>main</strong>’:<br>
 → 389     main()</p>
<p>~\main.py in main()<br>
200<br>
201     for epoch in range(start_epoch, args.epochs + 1):<br>
 → 202         train(train_loader, net, loss, epoch, optimizer, get_lr, args.save_freq, save_dir)<br>
203         validate(val_loader, net, loss)<br>
204</p>
<p>~\main.py in train(data_loader, net, loss, epoch, optimizer, get_lr, save_freq, save_dir)<br>
218         coord = Variable(coord.cuda(non_blocking = True)).cpu<br>
219<br>
 → 220         output = net(data, coord)<br>
221         loss_output = loss(output, target)<br>
222         optimizer.zero_grad()</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\parallel\data_parallel.py in forward(self, *inputs, **kwargs)<br>
164<br>
165             if len(self.device_ids) == 1:<br>
 → 166                 return self.module(*inputs[0], **kwargs[0])<br>
167             replicas = self.replicate(self.module, self.device_ids[:len(inputs)])<br>
168             outputs = self.parallel_apply(replicas, inputs, kwargs)</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>~\res18.py in forward(self, x, coord)<br>
95<br>
96     def forward(self, x, coord):<br>
—&gt; 97         out = self.preBlock(x)<span class="hashtag">#16</span><br>
98         out_pool,indices0 = self.maxpool1(out)<br>
99         out1 = self.forw1(out_pool)<span class="hashtag">#32</span></p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\container.py in forward(self, input)<br>
137     def forward(self, input):<br>
138         for module in self:<br>
 → 139             input = module(input)<br>
140         return input<br>
141</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py in forward(self, input)<br>
585<br>
586     def forward(self, input: Tensor) → Tensor:<br>
 → 587         return self._conv_forward(input, self.weight, self.bias)<br>
588<br>
589</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py in _conv_forward(self, input, weight, bias)<br>
580                 self.groups,<br>
581             )<br>
 → 582         return F.conv3d(<br>
583             input, weight, bias, self.stride, self.padding, self.dilation, self.groups<br>
584         )</p>
<p>TypeError: conv3d() received an invalid combination of arguments - got (builtin_function_or_method, Parameter, Parameter, tuple, tuple, tuple, int), but expected one of:</p>
<ul>
<li>(Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)<br>
didn’t match because some of the arguments have invalid types: (builtin_function_or_method, Parameter, Parameter, tuple, tuple, tuple, int)</li>
<li>(Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)<br>
didn’t match because some of the arguments have invalid types: (builtin_function_or_method, Parameter, Parameter, tuple, tuple, tuple, int)</li>
</ul>

username: eqy
cooked: <p>You probably want <code>coord = Variable(coord.cuda(non_blocking = True)).cpu()</code> rather than <code>coord = Variable(coord.cuda(non_blocking = True)).cpu</code>.</p>

username: Mhansy
cooked: <p>Thanks it worked! But I am facing the memory issue.</p>
<p>RuntimeError                              Traceback (most recent call last)<br>
~\main.py in <br>
387         return output<br>
388 if <strong>name</strong> == ‘<strong>main</strong>’:<br>
 → 389     main()</p>
<p>~\main.py in main()<br>
200<br>
201     for epoch in range(start_epoch, args.epochs + 1):<br>
 → 202         train(train_loader, net, loss, epoch, optimizer, get_lr, args.save_freq, save_dir)<br>
203         validate(val_loader, net, loss)<br>
204</p>
<p>~\main.py in train(data_loader, net, loss, epoch, optimizer, get_lr, save_freq, save_dir)<br>
218         coord = Variable(coord.cuda(non_blocking = True)).cpu()<br>
219<br>
 → 220         output = net(data, coord)<br>
221         loss_output = loss(output, target)<br>
222         optimizer.zero_grad()</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\parallel\data_parallel.py in forward(self, *inputs, **kwargs)<br>
164<br>
165             if len(self.device_ids) == 1:<br>
 → 166                 return self.module(*inputs[0], **kwargs[0])<br>
167             replicas = self.replicate(self.module, self.device_ids[:len(inputs)])<br>
168             outputs = self.parallel_apply(replicas, inputs, kwargs)</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>~\res18.py in forward(self, x, coord)<br>
110         comb3 = self.back3(torch.cat((rev3, out3), 1))#96+96<br>
111         <span class="hashtag">#comb3</span> = self.drop(comb3)<br>
 → 112         rev2 = self.path2(comb3)<br>
113<br>
114         comb2 = self.back2(torch.cat((rev2, out2,coord), 1))#64+64</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\container.py in forward(self, input)<br>
137     def forward(self, input):<br>
138         for module in self:<br>
 → 139             input = module(input)<br>
140         return input<br>
141</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)<br>
1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks<br>
1050                 or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1051             return forward_call(*input, **kwargs)<br>
1052         # Do not call functions when jit is used<br>
1053         full_backward_hooks, non_full_backward_hooks = [], []</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\batchnorm.py in forward(self, input)<br>
165         used for normalization (i.e. in eval mode when buffers are not None).<br>
166         “”"<br>
 → 167         return F.batch_norm(<br>
168             input,<br>
169             # If buffers are not to be tracked, ensure that they won’t be updated</p>
<p>C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\functional.py in batch_norm(input, running_mean, running_var, weight, bias, training, momentum, eps)<br>
2279         _verify_batch_size(input.size())<br>
2280<br>
 → 2281     return torch.batch_norm(<br>
2282         input, weight, bias, running_mean, running_var, training, momentum, eps, torch.backends.cudnn.enabled<br>
2283     )</p>
<p>RuntimeError: CUDA out of memory. Tried to allocate 54.00 MiB (GPU 0; 24.00 GiB total capacity; 8.34 GiB already allocated; 0 bytes free; 8.40 GiB reserved in total by PyTorch)</p>