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

Enhance ProgramDesc constructor taking protobuf string for RNN #8161

Closed
kexinzhao opened this issue Feb 5, 2018 · 1 comment · Fixed by #8176
Closed

Enhance ProgramDesc constructor taking protobuf string for RNN #8161

kexinzhao opened this issue Feb 5, 2018 · 1 comment · Fixed by #8176
Assignees
Labels
预测 原名Inference,包含Capi预测问题等

Comments

@kexinzhao
Copy link
Contributor

kexinzhao commented Feb 5, 2018

Right now, when constructing a ProgramDesc instance from a proto::ProgramDesc, there will be error for test_rnn_encoder_decoder.

The reason is the following code:

for (const proto::OpDesc::Attr &attr : desc_.attrs()) {
std::string attr_name = attr.name();
if (attr.type() != proto::AttrType::BLOCK) {
attrs_[attr_name] = GetAttrValue(attr);
} else {
auto bid = attr.block_idx();
attrs_[attr_name] = prog->MutableBlock(bid);
}
}

where it tries to assign a block pointer that hasn't been created yet (because the ProgramDesc constructor calls the BlockDesc constructor one by one following the order of the block idx) as a attribute to a RNN while operator.

This is issue will be fixed together with #8062 and #8059

@kexinzhao kexinzhao self-assigned this Feb 5, 2018
@kexinzhao kexinzhao added the 预测 原名Inference,包含Capi预测问题等 label Feb 5, 2018
@sidgoyal78
Copy link
Contributor

I think this is also relevant to the Machine translation chapter (Issue #7999). I get weird and similar outputs when i try to save the model for the NMT chapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
预测 原名Inference,包含Capi预测问题等
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants