Error while using Multi-processing
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 701
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I have completed a project using dynet 1.1. According to xor-mp and rnnlm-mp, I've implemented multi-processing and everything seems alright. No errors reported, train loss goes down after every epoch and I can use the model saved to predict. But I found that the model saved is always the initial model. So I debug my project and step into run_parent in mp.h, I found that every changes made by child's process doesn't seems to appear in run_parent. For example, I put an integer i in learner as its attribute and initialize it to 0. Then I change its value to 7 in LearnFromDatum, and print its value in SaveModel. Then I debug my project, step into run_parent. After runDataset, the child process us LearnFromDatum and print train loss. Then I use "print SaveModel()" in gdb, it shows that the attribute i in learner is still 0(it should have been changed in LearnFromDatum to 7 while training). So I get readlly confused, it seems that the learn in run_parent is a different object in run_child.
Can you give me some advices to solve it? The project is not simple so it will be hard to recode it in dynet 2.0. Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.