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

GSConv implementation #34

Open
zeobec opened this issue Aug 26, 2024 · 3 comments
Open

GSConv implementation #34

zeobec opened this issue Aug 26, 2024 · 3 comments

Comments

@zeobec
Copy link

zeobec commented Aug 26, 2024

Currently, im trying to implement GSConv module into Yolov10b module.  
conv.py
image

task.py
image

also imported module in init.py
image

.yaml
image

however, i received this error message
image
image

What's the possible reason that could be the source of the error?

@AlanLi1997
Copy link
Owner

@zeobec You should note the definition of the Conv in YOLOv10. Try to use this GSConv:

  class GSConv(nn.Module):
      # GSConv https://github.com/AlanLi1997/slim-neck-by-gsconv
      def __init__(self, c1, c2, k=1, s=1, g=1, d=1, act=True):
          super().__init__()
          c_ = c2 // 2
          self.cv1 = Conv(c1, c_, k, s, None, g, d, act)
          self.cv2 = Conv(c_, c_, 5, 1, None, c_, d, act)
  
      def forward(self, x):
          x1 = self.cv1(x)
          x2 = torch.cat((x1, self.cv2(x1)), 1)
          # shuffle
          y = x2.reshape(x2.shape[0], 2, x2.shape[1] // 2, x2.shape[2], x2.shape[3])
          y = y.permute(0, 2, 1, 3, 4)
          return y.reshape(y.shape[0], -1, y.shape[3], y.shape[4])

I have not checked the definition of "Conv" in YOLOv10 yet, so please don't hesitate to let me know if you have any further questions.

@zeobec
Copy link
Author

zeobec commented Sep 26, 2024

hi, thankyou for your response. i noticed that you have added new parameter which is d. Based on my understanding, is it true that d is representing dilation? would you mind to explain why you add the new parameter to make the module works?

@AlanLi1997
Copy link
Owner

AlanLi1997 commented Sep 27, 2024

hi, thankyou for your response. i noticed that you have added new parameter which is d. Based on my understanding, is it true that d is representing dilation? would you mind to explain why you add the new parameter to make the module works?

Is your project have worked? You need to correctly define the "Conv" class in the Yolov10 to make it works. NOTE: please check the definition of "Conv" in YOLOv10.

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

3 participants
@AlanLi1997 @zeobec and others