p517332051 opened a new issue #18476:
URL: https://github.com/apache/incubator-mxnet/issues/18476
## Description
(A clear and concise description of what the bug is.)
用C接口初始化一个模型,然后多线程去调用这个模型出bug。
后面查出来是这个文件下src/executor/graph_executor.cc的 1398行
/*
rshape = graph_.MoveCopyAttr<mxnet::ShapeVector>("shape");
*/
他会把shape这个这个属性给erase掉,然后别的线程再跑到这行就报错,目前已经把1398行改成
/*
if(is_train){
rshape = graph_.MoveCopyAttr<mxnet::ShapeVector>("shape");
}
else{
rshape = graph_.CopyAttr<mxnet::ShapeVector>("shape");
}
template<typename T>
inline T Graph::CopyAttr(const std::string& attr_name) {
auto it = attrs.find(attr_name);
CHECK(it != attrs.end())
<< "Cannot find attribute " << attr_name << " in the graph";
std::shared_ptr<any> sptr = it->second;
// attrs.erase(it);
if (sptr.unique()) {
return std::move(nnvm::get<T>(*sptr));
} else {
return nnvm::get<T>(*sptr);
}
}
*/
### Error Message
(Paste the complete error message. Please also include stack trace by
setting environment variable `DMLC_LOG_STACK_TRACE_DEPTH=10` before running
your script.)
## To Reproduce
(If you developed your own code, please provide a short script that
reproduces the error. For existing examples, please provide link.)
### Steps to reproduce
(Paste the commands you ran that produced the error.)
1.
2.
## What have you tried to solve it?
1.
2.
## Environment
We recommend using our script for collecting the diagnositc information. Run
the following command and paste the outputs below:
```
curl --retry 10 -s
https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py |
python
# paste outputs here
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]