コード生成でのcategoricalからcharへの変換について
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tomoki Monden
le 6 Juin 2020
Commenté : Tomoki Monden
le 8 Juin 2020
Classify Static Image Using Deep Learning on Raspberry Pi を参考にRaspberry Pi上で機械学習を行っています。
その際
[label,score] = net.classify(imgSizeAdjusted);
の識別結果をechoに用いてファイルに書き込みたく
echoText = 'echo ' + char(label) + ' >> result.txt';
というコードを記述したところ「コード生成では、categorical に対して char メソッドがサポートされていません。」というエラーが表示されました。
コード生成でcategoricalをchar型に変換する方法があれば教えていただきたいです。
0 commentaires
Réponse acceptée
Ryuhei Funada
le 8 Juin 2020
Modifié(e) : Ryuhei Funada
le 8 Juin 2020
label = cellstr(label);
label{1}でchar型で抜き出す。
でいかがでしょうか?
下記の
web(fullfile(docroot, 'vision/examples/code-generation-for-object-detection-using-yolo-v2.html'))
%convert categorical labels to cell array of charactor vectors for MATLAB
の部分をご参照ください。
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur イメージを使用した深層学習 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!