I ran the 'Sliding Inference and Test' part, below was the message I got:
Loading from /mnt/a/DP_learn/Slide-SAM/slidesam.pth
Checking Data range: [-200.0, 400.0]
Ends for no mask.
No masks
Ends for no mask.
Save to mask.nii.gz
Save to gt.nii.gz
Then I continued to run 'Testset Validation' part, the following error message popped: 'No module named 'datasets.eval_dataloader' '
I wanna know where can I get the eval_dataloader file?
Above was the older version of the code, I noticed that you've updated a few things so I downloaded the newer version. This was the error showed up while I ran 'training from scratch' part:
Traceback (most recent call last):
File "/home/wayne/anaconda3/envs/SAM/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 74, in _wrap
fn(i, *args)
File "/mnt/a/DP_learn/Slide-SAM_0326ver/core/ddp.py", line 77, in ddp_train
learner.load_pretrained_model(sam_checkpoint)
File "/mnt/a/DP_learn/Slide-SAM_0326ver/core/learner5.py", line 33, in load_pretrained_model
model_state_dict['prompt_encoder.mask_downscaling.0.weight'] = repeat(state_dict['prompt_encoder.mask_downscaling.0.weight'], "a 1 c d -> a b c d", b=3)
File "/home/wayne/anaconda3/envs/SAM/lib/python3.8/site-packages/einops/einops.py", line 641, in repeat
return reduce(tensor, pattern, reduction="repeat", **axes_lengths)
File "/home/wayne/anaconda3/envs/SAM/lib/python3.8/site-packages/einops/einops.py", line 533, in reduce
raise EinopsError(message + "\n {}".format(e))
einops.EinopsError: Error while processing repeat-reduction pattern "a 1 c d -> a b c d".
Input tensor shape: torch.Size([4, 3, 2, 2]). Additional info: {'b': 3}.
Shape mismatch, 3 != 1
I don't quite know how to fix the 'shape mismatch' problem.
I ran the 'Sliding Inference and Test' part, below was the message I got: Loading from /mnt/a/DP_learn/Slide-SAM/slidesam.pth Checking Data range: [-200.0, 400.0] Ends for no mask. No masks Ends for no mask. Save to mask.nii.gz Save to gt.nii.gz Then I continued to run 'Testset Validation' part, the following error message popped: 'No module named 'datasets.eval_dataloader' ' I wanna know where can I get the eval_dataloader file?
Above was the older version of the code, I noticed that you've updated a few things so I downloaded the newer version. This was the error showed up while I ran 'training from scratch' part: Traceback (most recent call last): File "/home/wayne/anaconda3/envs/SAM/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 74, in _wrap fn(i, *args) File "/mnt/a/DP_learn/Slide-SAM_0326ver/core/ddp.py", line 77, in ddp_train learner.load_pretrained_model(sam_checkpoint) File "/mnt/a/DP_learn/Slide-SAM_0326ver/core/learner5.py", line 33, in load_pretrained_model model_state_dict['prompt_encoder.mask_downscaling.0.weight'] = repeat(state_dict['prompt_encoder.mask_downscaling.0.weight'], "a 1 c d -> a b c d", b=3) File "/home/wayne/anaconda3/envs/SAM/lib/python3.8/site-packages/einops/einops.py", line 641, in repeat return reduce(tensor, pattern, reduction="repeat", **axes_lengths) File "/home/wayne/anaconda3/envs/SAM/lib/python3.8/site-packages/einops/einops.py", line 533, in reduce raise EinopsError(message + "\n {}".format(e)) einops.EinopsError: Error while processing repeat-reduction pattern "a 1 c d -> a b c d". Input tensor shape: torch.Size([4, 3, 2, 2]). Additional info: {'b': 3}. Shape mismatch, 3 != 1 I don't quite know how to fix the 'shape mismatch' problem.
Thank you for the reply.