I changed the backbone network of yolo7 to shufflenetv1, and the following problems occurred during the test.py,what can i do

Viewed 26

enter image description here

No problem when training,but run test.py......,my def channel_shuffle(self, x) have problem?[enter image description here][2]

my code :

def channel_shuffle(self, x):
    x1=x
    batchsize, num_channels, height, width = x.data.size()
    # print(height,width)
    assert (num_channels % self.group) == 0
    # group_channels = num_channels // self.group
    # x = x.reshape(batchsize, group_channels, self.group, height, width)
    # x = x.permute(0, 2, 1, 3, 4)
    # x = x.reshape(batchsize, self.group*group_channels, height, width)
    b_n = batchsize * num_channels // self.group
    y = x.reshape(b_n, self.group,height*width)
    y = y.permute(1, 0, 2)
    y = y.reshape(-1, num_channels, height, width)
    print(y.size())
    return y
0 Answers
Related