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

Is this right? #31

Open
XP-CHRC opened this issue Mar 17, 2020 · 4 comments
Open

Is this right? #31

XP-CHRC opened this issue Mar 17, 2020 · 4 comments

Comments

@XP-CHRC
Copy link

XP-CHRC commented Mar 17, 2020

def concat_shuffle_split_abstract(x, y):
x_cp_1 = x[:, :, :, 0::2]
y_cp_1 = y[:, :, :, 0::2]
x=tf.concat([x_cp_1, y_cp_1], axis=3)

x_cp_2 = x[:, :, :, 1::2]
y_cp_2 = y[:, :, :, 1::2]
y = tf.concat([x_cp_2, y_cp_2], axis=3)

return x, y

Why x_cp_2 = (local variable)x[:, :, :, 1::2] ? i dont know the reason.
Looking forward to your reply.

@610265158
Copy link
Owner

610265158 commented Mar 19, 2020

Oh , that was modified for tensorflowlite, because tflite not support 5-d transpose,
so i make it by slice. just take half of the x and y, stride 2 in channel , and concat them.

I think you can refer to the 'simple concat shuffle split' by transpose and split. as many othe implements.

And sorry it bothers you.There is no needs to concern that a lot, other net structures works the same, basicly.

good luck

@XP-CHRC
Copy link
Author

XP-CHRC commented Mar 23, 2020

Oh , that was modified for tensorflowlite, because tflite not support 5-d transpose,
so i make it by slice. just take half of the x and y, stride 2 in channel , and concat them.

I think you can refer to the 'simple concat shuffle split' by transpose and split. as many othe implements.

And sorry it bothers you.There is no needs to concern that a lot, other net structures works the same, basicly.

good luck
@610265158
啊啊啊,我懂你的意思,其实我想问的是x_cp_2 = x[:, :, :, 1::2]中x不是一个局部变量吗?它应该覆盖了输入变量x,所以想问一下这块是怎么回事?

@KarlKulator
Copy link

Oh , that was modified for tensorflowlite, because tflite not support 5-d transpose,
so i make it by slice. just take half of the x and y, stride 2 in channel , and concat them.

I think you can refer to the 'simple concat shuffle split' by transpose and split. as many othe implements.

And sorry it bothers you.There is no needs to concern that a lot, other net structures works the same, basicly.

good luck

Hi,
did you check if this line is correct?: (shufflenet.py:29) x_cp_2 = x[:, :, :, 1::2]

The x that is taken here comes from the local variable x (calculated in line 26) and not from the input variable x.

Additionally I get different results, when I exchange concat_shuffle_split_abstract with concat_shuffle_split. So these two do not seems to be the exact same implementation of the shuffling layer.

@610265158
Copy link
Owner

610265158 commented Jun 22, 2020

Yes, that is a mistake.
It is better use the norm shuffle op (concat_shuffle_split).

And to correct this mistake need to retrain the model.

Now i intend to reimplement it based on mobilenetv3, when i get time.

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