如何在不从头开始重新训练的情况下更新/附加新数据到我的模型?我的数据集是图像,输出是预测情绪。
model.fit(x=train_image, y=train_label, epochs=1, batch_size=1)
Run Code Online (Sandbox Code Playgroud)
Model.fit 似乎没有附加我的新数据,而是覆盖模型。我的输出只有一个(我更新的最后一个)。
我已经搜索过这个,但效果不佳。
编辑1: 当我们丢失之前训练的数据时我们能做什么。简而言之,我们在训练完成后就丢失了训练数据,并且无法再次取回数据,我们必须保留的是从中完成的学习,并在收到新数据时重新训练模型。
对于我当前的 ocr 项目,我尝试使用 tesserect 使用 python 封面 pytesseract 将图像转换为文本文件。到目前为止,我只是将非常直的图像传递到我的模块中,因为它能够正确地找出该图像中的文本。但是现在当我传递旋转的图像时,它甚至无法识别一个单词。所以为了获得好的结果,我只需要以正确的方向传递图像。现在我想知道有什么方法可以在将图像传递到 ocr 模块之前确定图像的方向。请让我知道我可以使用哪些方法来进行方向检查。
这是我用来进行转换的方法:
def images_to_text(testImg):
print('Reading images form the directory..........')
dataFile=[]
for filename in os.listdir(testImg):
os.chdir(testImg)
# Define config parameters.
# '-l eng' for using the English language
# '--oem 1' for using LSTM OCR Engine
config = ('-l eng --oem 1 --psm 3')
# Read image from disk
im = cv2.imread(str(filename), cv2.IMREAD_COLOR)
# Run tesseract OCR on image
text = pytesseract.image_to_string(im, config=config)
#basic preprocessing of the text
text = text.replace('\t',' …Run Code Online (Sandbox Code Playgroud)