Hi Adrian
Getting the following issue after training.
Training was with 2040x2040 img, same size for mask.
val_auc: 243.786961
val_dice: 0.379771
best_cycle: 45
Now, i tried to run this with same sized image. got the below error. Not sure
FOV mask generated
Instantiating model = wnet
Loading trained weights from experiments/wnet_DRdb
d:\Dev\LWNET1\utils\model_saving_loading.py:16: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(checkpoint_path, map_location=device)
.....
File "d:\Dev\LWNET1\predict_images_test.py", line 322, in
full_pred, full_pred_bin = create_pred(model, im_tens, mask, coords_crop, original_sz, bin_thresh=bin_thresh, tta=tta)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\predict_images_test.py", line 120, in create_pred
logits = model(tens.unsqueeze(dim=0).to(device)).squeeze(dim=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\models\get_model.py", line 16, in forward
x1 = self.unet1(x)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\models\res_unet_adrian.py", line 123, in forward
x = self.first(x)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\models\res_unet_adrian.py", line 35, in forward
out = self.block(x)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\conv.py", line 458, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\conv.py", line 454, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
Hi Adrian Getting the following issue after training. Training was with 2040x2040 img, same size for mask. val_auc: 243.786961 val_dice: 0.379771 best_cycle: 45
Now, i tried to run this with same sized image. got the below error. Not sure
torch.load
withweights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value forweights_only
will be flipped toTrue
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user viatorch.serialization.add_safe_globals
. We recommend you start settingweights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. checkpoint = torch.load(checkpoint_path, map_location=device).....
File "d:\Dev\LWNET1\predict_images_test.py", line 322, in
full_pred, full_pred_bin = create_pred(model, im_tens, mask, coords_crop, original_sz, bin_thresh=bin_thresh, tta=tta)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\predict_images_test.py", line 120, in create_pred
logits = model(tens.unsqueeze(dim=0).to(device)).squeeze(dim=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\models\get_model.py", line 16, in forward
x1 = self.unet1(x)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\models\res_unet_adrian.py", line 123, in forward
x = self.first(x)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Dev\LWNET1\models\res_unet_adrian.py", line 35, in forward
out = self.block(x)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\container.py", line 219, in forward
input = module(input)
^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\conv.py", line 458, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Master\anaconda3\envs\lwnet\Lib\site-packages\torch\nn\modules\conv.py", line 454, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same