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

模型参数导入问题 #7

Open
Paladnix opened this issue Apr 22, 2018 · 1 comment
Open

模型参数导入问题 #7

Paladnix opened this issue Apr 22, 2018 · 1 comment

Comments

@Paladnix
Copy link

使用embedding训练后的模型在测试的时候无法导入,报错是参数的shape不对。
报的错误是我在将一个size是num_filters的参数塞给一个size是1的变量。

不知道怎么解决。

报错核心信息如下:
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [1] rhs shape= [512]
[[Node: save/Assign_8 = Assign[T=DT_FLOAT, _class=["loc:@conv-maxpool-3/b"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](conv-maxpool-3/b, save/RestoreV2_8/_69)]]

@Paladnix
Copy link
Author

找到了问题,在您代码的Config.loadConfig最后一个的self.num_filters应该是self.cnn_numLayers
这里的笔误导致了参数的加载时size对不上。

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

1 participant