Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A beginner's question #3

Open
guyaxsx opened this issue Jan 19, 2022 · 5 comments
Open

A beginner's question #3

guyaxsx opened this issue Jan 19, 2022 · 5 comments

Comments

@guyaxsx
Copy link

guyaxsx commented Jan 19, 2022

您好,冒昧打扰。
在 main.py line39 中 add_argument() 关键字description是否有误?

Hello, take the liberty of interrupting.
In main.py line39_ Is the argument() keyword 'description' incorrect?

parser.add_argument('--params', description='params file to be loaded')
typeerror

@Lumos-Jiateng
Copy link

I've got the same problems with yours! Have you ever got a solution?
Thank you very much ~

@Lumos-Jiateng
Copy link

I think 'description' should be changed into a 'help'

@guyaxsx
Copy link
Author

guyaxsx commented Feb 18, 2022

我又换了一个笨方法,解决了这个问题。但是后面还会有新问题。就没有再尝试复现这个项目。

方法如下:

if name == 'main':

# load hyperparameters
parser = argparse.ArgumentParser(description='CRFL')#创建解析器 description是对程序功能的描述
parser.add_argument('--params', description='params file to be loaded')
#parser.add_argument('--params', type=str, default='./configs/mnist_params.yaml', help="path to config file")
#parser.add_argument('--params', type=str, default='./configs/emnist_params.yaml', help="path to config file")
#parser.add_argument('--params', type=str, default='./configs/loan_params.yaml', help="path to config file")

#以上代码的对应命令,源码有误,需要修改。每次训练完成切换训练数据集就需要更改
#python main.py --params=configs/mnist_params.yaml #(已经跑完了)
#python main.py --params=configs/emnist_params.yaml (已经跑完了)
#python main.py --params=configs/loan_params.yaml  (已经跑完了)

args = parser.parse_args()#解析输入的参数

@Lumos-Jiateng
Copy link

Lumos-Jiateng commented Feb 18, 2022 via email

@guyaxsx
Copy link
Author

guyaxsx commented Feb 18, 2022

应该是版本问题,我之前试过换成help,但是没有成功。就换了这个方法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants