Closed HaliComing closed 2 years ago
If you are training, the loss is low and the validation dataset accuracy is high, but when executing demo.py, the accuracy is very low. You can refer to the following code to modify (demo.py):
converter = utils.strLabelConverter(params.alphabet) transformer = dataset.resizeNormalize((100, 32)) image = Image.open(image_path).convert('L') image = transformer(image) if torch.cuda.is_available():
to
converter = utils.strLabelConverter(params.alphabet) image = Image.open(image_path).convert('L') image = transforms.ToTensor()(image) image.sub_(0.5).div_(0.5) if torch.cuda.is_available():
enjoy !!!
If you are training, the loss is low and the validation dataset accuracy is high, but when executing demo.py, the accuracy is very low. You can refer to the following code to modify (demo.py):
to
enjoy !!!