Skip to content

Commit

Permalink
Update rec_train.py
Browse files Browse the repository at this point in the history
修正from torch import optim
  • Loading branch information
light201212 authored Sep 10, 2020
1 parent f93e47f commit 649339c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/rec_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import torch
from tqdm import tqdm
from torch import nn

from torch import optim
from torchocr.networks import build_model, build_loss
from torchocr.datasets import build_dataloader
from torchocr.utils import get_logger, weight_init, load_checkpoint, save_checkpoint
Expand Down Expand Up @@ -77,7 +77,7 @@ def build_optimizer(params, config):
优化器
Returns:
"""
from torch import optim

opt_type = config.pop('type')
opt = getattr(optim, opt_type)(params, **config)
return opt
Expand Down

0 comments on commit 649339c

Please sign in to comment.