Codegen respond with an error: "??Expected a character vector. "
이전 댓글 표시
When I use my training results of DDPG model to generate GPU code, there always respond an error. I followed the instruction "Deploy Trained Reinforcement Learning Policies" from help document, and it runs well in other exmples. Here is error report:

And return code:
>>codegen('-config','cfg','evaluatePolicy','-args',argstr,'-report');
??? Expected a character vector.
Code generation failed: View Error Report
Incorrect use of codegen
댓글 수: 7
Emmanouil Tzorakoleftherakis
2021년 5월 13일
can you provide the rest of the code you are running? The doc page has some steps before running 'codegen'. For example what is 'cfg'? It seems there is a typo somewhere based on the error msg
Haonan Ding
2021년 5월 13일
伯儒 周
2021년 9월 8일
I know how to solve the problem!
You should creat a new folder and the path can not contain any chinese symbal and the coder will work.
XingZhou Mu
2024년 4월 14일
이동: Voss
2024년 4월 14일
Hello, did you solve this problem, I am also having the same problem
XingZhou Mu
2024년 4월 14일
Hello, did you solve this problem, I am also having the same problem
Jie Li
2024년 5월 9일
竟然是中文路径的问题!改成英文路径就OK了
답변 (1개)
Paras Gupta
2024년 6월 21일
0 개 추천
Hello Haonan,
I understand that you're encountering the error "??? Expected a character vector."
This issue could arise if the name of the specified MAT-file or the absolute file path to the MAT-file contains non-ASCII characters, which are not supported by codegen. Please refer to the 'Limitations' section of the following documentation.
You can also refer to the below documentation for more information on character encoding in code generation:
Hope this resolves the query.
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Code Generation Fundamentals에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!