dynamic icon indicating copy to clipboard operation
dynamic copied to clipboard

The segmentation code is not working; there is a problem in tensor dimension

Open G-zebra opened this issue 2 years ago • 3 comments

The InitializationNotebook is not working properly. As segmentation is the core of this repository, it would be great if the developers can fix the issue and update their code.

The error below has been reported many times:

        RuntimeError                              Traceback (most recent call last)

~\AppData\Local\Temp\2\ipykernel_6640\517464012.py in <cell line: 19>() 32 x = x.to(device) 33 #print('x shape', x.shape) ---> 34 y = np.concatenate([model(x[i:(i + block), :, :, :])["out"].detach().cpu().numpy() for i in range(0, x.shape[0], block)]).astype(np.float16) 35 print(y.shape) 36 start = 0

RuntimeError: Given groups=1, weight of size [45, 3, 1, 7, 7], expected input[1, 104, 3, 112, 112] to have 3 channels, but got 104 channels instead

G-zebra avatar Jun 23 '22 17:06 G-zebra

Hello, I have the same problem, did you find any solutions for it?

jesuscano04 avatar Dec 15 '22 13:12 jesuscano04

Did you perhaps accidentally pass in a clips argument to the dataset initialization in

dataloader = torch.utils.data.DataLoader(echonet.datasets.Echo(split="external_test", external_test_location = videosFolder, target_type=["Filename"], length=None, period=1, mean=mean, std=std), batch_size=10, num_workers=0, shuffle=False, pin_memory=(device.type == "cuda"), collate_fn=collate_fn)

?

Or maybe in echonet/datasets/echo.py you accidentally removed the

if (self.clips == 1):
          video = video[0]

clause? I received this issue due to both of these as I was trying to edit various snippets of code to debug the notebook.

Also, change the indexing variable from i to j. I'm not sure why this doesn't result in some other error, but it's safe to do so anyway. Maybe it's some scoping functionality that I'm not familiar with in python.

LitMSCTBB avatar Dec 29 '22 02:12 LitMSCTBB

Check out #11, it is not merged but they did fix quite some bugs in the notebook there.

tristan-deep avatar Nov 20 '23 08:11 tristan-deep