mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 23:49:06 +08:00
fix string conversion in lstmtrainer
This commit is contained in:
parent
cca107d5f6
commit
a2444bc55e
@ -345,7 +345,7 @@ bool LSTMTrainer::MaintainCheckpoints(TestCallback tester, STRING* log_msg) {
|
|||||||
checkpoint_writer_->Run(NO_BEST_TRAINER, this, &best_trainer_);
|
checkpoint_writer_->Run(NO_BEST_TRAINER, this, &best_trainer_);
|
||||||
if (error_rate < error_rate_of_last_saved_best_ * kBestCheckpointFraction) {
|
if (error_rate < error_rate_of_last_saved_best_ * kBestCheckpointFraction) {
|
||||||
STRING best_model_name = DumpFilename();
|
STRING best_model_name = DumpFilename();
|
||||||
if (!(*file_writer_)(best_trainer_, best_model_name)) {
|
if (!(*file_writer_)(best_trainer_, best_model_name.c_str())) {
|
||||||
*log_msg += " failed to write best model:";
|
*log_msg += " failed to write best model:";
|
||||||
} else {
|
} else {
|
||||||
*log_msg += " wrote best model:";
|
*log_msg += " wrote best model:";
|
||||||
@ -384,7 +384,7 @@ bool LSTMTrainer::MaintainCheckpoints(TestCallback tester, STRING* log_msg) {
|
|||||||
// Write a current checkpoint.
|
// Write a current checkpoint.
|
||||||
GenericVector<char> checkpoint;
|
GenericVector<char> checkpoint;
|
||||||
if (!checkpoint_writer_->Run(FULL, this, &checkpoint) ||
|
if (!checkpoint_writer_->Run(FULL, this, &checkpoint) ||
|
||||||
!(*file_writer_)(checkpoint, checkpoint_name_)) {
|
!(*file_writer_)(checkpoint, checkpoint_name_.c_str())) {
|
||||||
*log_msg += " failed to write checkpoint.";
|
*log_msg += " failed to write checkpoint.";
|
||||||
} else {
|
} else {
|
||||||
*log_msg += " wrote checkpoint.";
|
*log_msg += " wrote checkpoint.";
|
||||||
|
Loading…
Reference in New Issue
Block a user