Merge pull request #4163 from LDOUBLEV/release/2.3

fix load model
This commit is contained in:
Double_V 2021-09-24 11:06:46 +08:00 committed by GitHub
commit 7cd1002543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ from paddle.jit import to_static
from ppocr.modeling.architectures import build_model
from ppocr.postprocess import build_post_process
from ppocr.utils.save_load import init_model
from ppocr.utils.save_load import load_dygraph_params
from ppocr.utils.logging import get_logger
from tools.program import load_config, merge_config, ArgsParser
@ -99,7 +99,7 @@ def main():
else: # base rec model
config["Architecture"]["Head"]["out_channels"] = char_num
model = build_model(config["Architecture"])
init_model(config, model)
_ = load_dygraph_params(config, model, logger, None)
model.eval()
save_path = config["Global"]["save_inference_dir"]