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

test运行报错 #7

Open
VincentLs opened this issue Nov 5, 2020 · 3 comments
Open

test运行报错 #7

VincentLs opened this issue Nov 5, 2020 · 3 comments

Comments

@VincentLs
Copy link

您好,我是新手
测试的时候需要修改哪些位置,
我已经改了项目说明里的三个路径,
但是argparse返回了一个错误信息,
TypeError: 'required' is an invalid argument for positionals.

@DDuring
Copy link

DDuring commented Sep 16, 2022

举个例子
我的代码是这样

if name == 'main':
parser = argparse.ArgumentParser()
parser.add_argument('--weights-file', default="BLAH_BLAH/srcnn_x3.pth", type=str)
parser.add_argument('--image-file', default="data/ppt3.bmp", type=str)
parser.add_argument('--scale', type=int, default=3)
args = parser.parse_args()

我想你需要删除 required=True ,然后在后面附带上正确的路径,希望可以帮到你。

For example
My code is like this

if name == 'main':
parser = argparse.ArgumentParser()
parser.add_argument('--weights-file', default="BLAH_BLAH/srcnn_x3.pth", type=str)
parser.add_argument('--image-file', default="data/ppt3.bmp", type=str)
parser.add_argument('--scale', type=int, default=3)
args = parser.parse_args()

I think you need to remove required=True and then append the correct path, hope it helps you.

@DDuring
Copy link

DDuring commented Sep 16, 2022

您好,我是新手 测试的时候需要修改哪些位置, 我已经改了项目说明里的三个路径, 但是argparse返回了一个错误信息, TypeError: 'required' is an invalid argument for positionals.

@VincentLs
Copy link
Author

谢谢!

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