Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
G-zebra opened this issue Jun 23, 2022 · 3 comments

Comments

@G-zebra
Copy link

G-zebra commented Jun 23, 2022

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

@jesuscano04
Copy link

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

@LitMSCTBB
Copy link

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.

@tristan-deep
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants