mindocr icon indicating copy to clipboard operation
mindocr copied to clipboard

The learning rate detected in the optimizer is not a Parameter type, so it is not recorded. Its type is '_IteratorLearningRate'.

Open TanateT opened this issue 2 years ago • 3 comments

Hello author, when I was using SummaryCollector for visualization, I encountered the following error: The learning rate detected in the optimizer is not a Parameter type, so it is not recorded It type is'InteratorLearningRate '. May I ask what is causing this?

TanateT avatar Mar 06 '24 12:03 TanateT

@TanateT Hello, thanks for your feedback. It seems that the problem was caused by an improper definition of the learning rate. You can try to debug the code on PyNative mode and to check the data type of the learning rate input to the optimizer. If you need further help, please provide more details on your code.

panshaowu avatar Mar 08 '24 03:03 panshaowu

@panshaowu , Hello,When I use the following code to train the icdar_15 dataset using CRNN and SVTR, the above error will appear. You can try it on the GPU. summary=SummaryCollector (summarid_dir='summary', collect_freq=100)

TanateT avatar Mar 08 '24 09:03 TanateT

@TanateT Hello, I tried to modify the python script tools/train.py (refer to Tutorials):

def main(cfg):
    ....
    # training
    model = ms.Model(train_net)
    summary_collector = SummaryCollector(summary_dir='summary_dir', collect_freq=100)
    model.train(
        cfg.scheduler.num_epochs,
        loader_train,
        callbacks=[eval_cb, summary_collector],
        dataset_sink_mode=cfg.train.dataset_sink_mode,
        initial_epoch=start_epoch,
    )

And then I tested the function of SummaryCollector on a GPU server (1080Ti, CUDA 10.1, MindSpore 2.2.11) using following commands:

clear && python tools/train.py -c configs/rec/crnn/crnn_icdar15.yaml

No errors were raised. And SummaryCollector worked normally. I could see the captured training info using MindInsight. I am not sure whether you added other customized codes which might cause problems. Could you please provide more details?

panshaowu avatar Mar 12 '24 12:03 panshaowu