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

文本分类相关问题 #29

Open
nanqiaobei opened this issue Mar 23, 2020 · 3 comments
Open

文本分类相关问题 #29

nanqiaobei opened this issue Mar 23, 2020 · 3 comments

Comments

@nanqiaobei
Copy link

您好,我发现了一些问,运行您的代码的时候出现了一些,发现维度的错误(你的代码模型部分我都没有改变)在routing 部分的b=b+K.batch_dot(outputs,u_hat_vecs,[2,3])计算它的耦合系数的时候,其中output维度是[224,16,16,16],u_hat_ves的维度是[226,16,48,16]报错是: Dimensions must be equal, but are 224 and 16 for 'capsule_3/conv2/add_2' (op: 'Add') with input shapes: [224,16,48], [224,16,16,16,48],第二个是:胶囊网络的动态路由迭代是一个迭代过程,您好像没有进行反向传播截断,这个地方是否需要进行反向传播截断.
我使用tf的矩阵相乘[224,16,16,16] x[224,16,16,48]得到[224,16,16,48] 我然后在第2个维度上进行相加变成[224,16,48]与加b,解决了routing 部分的问题,然后后面的poses的reshape 又出现了相关问题,
我使用的环境是python3.6和tf.1.14.0,这个应该会是环境配置问题吧,像请问下相关的问题,想拿你的模型做一个baseline 模型,作为引文,你的代码是应该没有写笔误吧,还是python3.6和python2.的问题

@yahiko-l
Copy link

yahiko-l commented Jul 3, 2020

上面的老哥,我使用python 2.7 + tensorflow 1.4可以跑通,并没有问题

@nanqiaobei
Copy link
Author

nanqiaobei commented Jul 22, 2020 via email

@Catherine-HFUT
Copy link

Catherine-HFUT commented Jul 24, 2020

python3.6+tf.version='1.14.0'跑,请问对于ValueError: Dimensions must be equal, but are 2425 and 16 for 'capsule_3/conv2/add_2' (op: 'Add') with input shapes: [2425,16,48], [2425,16,16,16,48].该怎么解决能具体说下,或者改好的参考下嘛

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