图片打印加上中文

master
wangchunlin 2 years ago
parent 58625ad25b
commit 3efee0de2b

@ -191,16 +191,16 @@ class MLModel:
ax1.plot(train_loss_history, label='Train Loss(训练损失)') ax1.plot(train_loss_history, label='Train Loss(训练损失)')
ax1.plot(val_loss_history, label='Validation Loss(验证损失)') ax1.plot(val_loss_history, label='Validation Loss(验证损失)')
ax1.set_title('Loss(损失)', fontproperties=font_prop) ax1.set_title('Loss(损失)', fontproperties=font_prop)
ax1.legend() ax1.legend(prop=font_prop)
ax2.plot(train_acc_history, label='Train Accuracy(训练正确率)') ax2.plot(train_acc_history, label='Train Accuracy(训练正确率)')
ax2.plot(val_acc_history, label='Validation Accuracy(验证正确率)') ax2.plot(val_acc_history, label='Validation Accuracy(验证正确率)')
ax2.set_title('Accuracy(正确率)', fontproperties=font_prop) ax2.set_title('Accuracy(正确率)', fontproperties=font_prop)
ax2.legend() ax2.legend(prop=font_prop)
ax3.plot(val_f1_history, label='Validation F1(验证F1得分)') ax3.plot(val_f1_history, label='Validation F1(验证F1得分)')
ax3.plot(val_precision_history, label='Validation Precision(验证精确率)') ax3.plot(val_precision_history, label='Validation Precision(验证精确率)')
ax3.plot(val_recall_history, label='Validation Recall(验证召回率)') ax3.plot(val_recall_history, label='Validation Recall(验证召回率)')
ax3.set_title('Precision Recall F1-Score (Macro Mean)(宏平均)', fontproperties=font_prop) ax3.set_title('Precision Recall F1-Score (Macro Mean)(宏平均)', fontproperties=font_prop)
ax3.legend() ax3.legend(prop=font_prop)
# 保存图片 # 保存图片
parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
train_process_path = os.path.join(parent_dir, self.config['train_process_path']) train_process_path = os.path.join(parent_dir, self.config['train_process_path'])

Loading…
Cancel
Save