I’m trying to use the new ResNeSt architecture in Fastai and I am getting an error I don’t quite understand. BTW here is the new and improved Resnet if you want to take a look:
It looks super promising. The error when I try to train is “TypeError: conv2d(): argument ‘input’ (position 1) must be Tensor, not bool”. Here is the full traceback:
TypeError Traceback (most recent call last)
in
20 freeze = True
21 unfreeze = False
—> 22 learn, data = fit(bs, size, findLR, lr, epoch, save, partial, load, unfreeze, freeze, justLoad, cb)
23
24 # load = ‘magicDetail_02-nguyenv7-NoGan_B__5-457807’in fit(bs, size, findLR, lr, epoch, save, partial, load, unfreeze, freeze, justLoad, cb)
55 base_loss = F.l1_loss
56
—> 57 body = create_body(arch, pretrained=True).cuda().eval()
58 requires_grad(body, False)
59~\Anaconda3\envs\Fastai_02\lib\site-packages\fastai\vision\learner.py in create_body(arch, pretrained, cut)
54 def create_body(arch:Callable, pretrained:bool=True, cut:Optional[Union[int, Callable]]=None):
55 “Cut off the body of a typically pretrainedmodel
atcut
(int) or cut the model as specified bycut(model)
(function).”
—> 56 model = arch(pretrained)
57 cut = ifnone(cut, cnn_config(arch)[‘cut’])
58 if cut is None:~\Anaconda3\envs\Fastai_02\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)~/.cache\torch\hub\zhanghang1989_ResNeSt_master\resnest\torch\resnet.py in forward(self, x)
286
287 def forward(self, x):
–> 288 x = self.conv1(x)
289 x = self.bn1(x)
290 x = self.relu(x)~\Anaconda3\envs\Fastai_02\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)~\Anaconda3\envs\Fastai_02\lib\site-packages\torch\nn\modules\container.py in forward(self, input)
98 def forward(self, input):
99 for module in self:
–> 100 input = module(input)
101 return input
102~\Anaconda3\envs\Fastai_02\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)~\Anaconda3\envs\Fastai_02\lib\site-packages\torch\nn\modules\conv.py in forward(self, input)
343
344 def forward(self, input):
–> 345 return self.conv2d_forward(input, self.weight)
346
347 class Conv3d(_ConvNd):~\Anaconda3\envs\Fastai_02\lib\site-packages\torch\nn\modules\conv.py in conv2d_forward(self, input, weight)
340 _pair(0), self.dilation, self.groups)
341 return F.conv2d(input, weight, self.bias, self.stride,
–> 342 self.padding, self.dilation, self.groups)
343
344 def forward(self, input):
> TypeError: conv2d(): argument ‘input’ (position 1) must be Tensor, not bool