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!