Machine-Learning-Collection icon indicating copy to clipboard operation
Machine-Learning-Collection copied to clipboard

RuntimeError: Given groups=1, weight of size [32, 3, 3, 3], expected input[30, 416, 416, 3] to have 3 channels, but got 416 channels instead

Open mth1996 opened this issue 4 years ago • 3 comments

RuntimeError: Given groups=1, weight of size [32, 3, 3, 3], expected input[30, 416, 416, 3] to have 3 channels, but got 416 channels instead

I get an Runtime Error when trying to train my model.

Someone ever encountered that problem and is able to help with that one ?

I cant really understand where these Dimension problems come from and which parameters i got to check.

Greetings!

mth1996 avatar Jun 18 '21 07:06 mth1996

I got something similar too, would really appreciate some assistance .

RuntimeError: Given groups=1, weight of size [256, 64, 4, 4], expected input[128, 128, 16, 16] to have 64 channels, but got 128 channels instead

Process finished with exit code 1

Gabriel-Yashim avatar Jul 22 '21 02:07 Gabriel-Yashim

That means your input should have 3 channels , but you give an input of 416 channels.

In your function, input size must be the form (N, C_in, H, W) and the output size is (N, C_out, H_out, W_out), where N, C, H, and W represents batch size, channel size, height and width, respectively.

I think the problem is one of two things - First , channel mismatch in your network defining code : Take a good look at the code Second , order of dimensions mismatch : You can permute the dimensions of your input tensor to fit the input rule (N, C_in, H, W).

chjin777 avatar Jan 15 '22 08:01 chjin777

I got your email, thank you very much 🙏

On Sat, Jan 15, 2022, 9:53 AM Chaejin Park @.***> wrote:

That means your input should have 3 channels , but you give an input of 416 channels.

In your function, input size must be the form (N, C_in, H, W) and the output size is (N, C_out, H_out, W_out), where N, C, H, and W represents batch size, channel size, height and width, respectively.

I think the problem is one of two things - First , channel mismatch in your network defining code : Take a good look at the code Second , order of dimensions mismatch : You can permute the dimensions of your input tensor to fit the input rule (N, C_in, H, W).

— Reply to this email directly, view it on GitHub https://github.com/aladdinpersson/Machine-Learning-Collection/issues/59#issuecomment-1013646109, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOL42FIBAG7P2JHKWNCCADTUWEYYZANCNFSM465DWCHQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.*** com>

Gabriel-Yashim avatar Jan 19 '22 09:01 Gabriel-Yashim