mindspore-ai / mindspore

MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
https://gitee.com/mindspore/mindspore
Apache License 2.0
4.3k stars 711 forks source link

Function must has 'return' statement, but missing in function 'info' at MindSpore/lib/python3.7/site-packages/mindspore/log.py:190. #220

Open para-zhou opened 1 year ago

para-zhou commented 1 year ago

Environment

Hardware Environment(Ascend/GPU/CPU):

/device gpu

Software Environment:

Describe the current behavior

Added logger in a construct function, can get above error

Fixed by adding return 0 to the log.py Then I got

RuntimeError: mindspore/ccsrc/pipeline/jit/parse/parse.cc:584 ParseStatement] Unsupported statement 'Try'.

And it turns out that there's try in the log.py file. So how should I print the variables in the construct function to check if my modification works well?? Thanks.

cxl-ll commented 1 year ago

Hello, the question has been received. We will analyze and reply as soon as possible. Please wait patiently.

MansonRi commented 1 year ago

mindspore not support use log in construct function during graph mode. if you want debug, you can run it in pynative mode.