mindspore-lab / mindocr

A toolbox of OCR models, algorithms, and pipelines based on MindSpore

Home Page:https://mindspore-lab.github.io/mindocr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

TanateT opened this issue · 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
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 ,
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 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?