From 3920960fbfecf1ab0de5a4040c6a8728df96127b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E9=80=B8=E8=B1=AA?= Date: Mon, 6 Mar 2023 04:50:12 +0000 Subject: [PATCH] demos/TTSArmLinux: Eliminate warnings about datatype mismatches > Paddle-Lite/lite/api/light_api.cc:462 CheckInputValid] Error input tensor precision type. Input index (0) Tensor name (text) Require precision type (int64_t) Input precision type (float). --- demos/TTSArmLinux/src/Predictor.hpp | 4 ++-- demos/TTSArmLinux/src/main.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/TTSArmLinux/src/Predictor.hpp b/demos/TTSArmLinux/src/Predictor.hpp index 6d4926fff..d32ed1fae 100644 --- a/demos/TTSArmLinux/src/Predictor.hpp +++ b/demos/TTSArmLinux/src/Predictor.hpp @@ -67,7 +67,7 @@ public: VOC_predictor_ = nullptr; } - bool RunModel(const std::vector &phones) { + bool RunModel(const std::vector &phones) { if (!IsLoaded()) { return false; } @@ -88,7 +88,7 @@ public: return true; } - std::unique_ptr GetAMOutput(const std::vector &phones) { + std::unique_ptr GetAMOutput(const std::vector &phones) { auto phones_handle = AM_predictor_->GetInput(0); phones_handle->Resize({static_cast(phones.size())}); phones_handle->CopyFromCpu(phones.data()); diff --git a/demos/TTSArmLinux/src/main.cc b/demos/TTSArmLinux/src/main.cc index ceb76358f..0bf78a7de 100644 --- a/demos/TTSArmLinux/src/main.cc +++ b/demos/TTSArmLinux/src/main.cc @@ -6,7 +6,7 @@ using namespace paddle::lite_api; -std::vector> sentencesToChoose = { +std::vector> sentencesToChoose = { // 009901 昨日,这名“伤者”与医生全部被警方依法刑事拘留。 {261, 231, 175, 116, 179, 262, 44, 154, 126, 177, 19, 262, 42, 241, 72, 177, 56, 174, 245, 37, 186, 37, 49, 151, 127, 69, 19, 179, 72, 69, 4, 260, 126, 177, 116, 151, 239, 153, 141}, // 009902 钱伟长想到上海来办学校是经过深思熟虑的。 @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) { std::cerr << "predictor init failed" << std::endl; return -1; } - + if (!predictor.RunModel(sentencesToChoose[sentencesIndex])) { std::cerr << "predictor run model failed" << std::endl; return -1;