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

First argument parsed incorrectly #117

Open
cirobr opened this issue Aug 3, 2022 · 0 comments
Open

First argument parsed incorrectly #117

cirobr opened this issue Aug 3, 2022 · 0 comments

Comments

@cirobr
Copy link

cirobr commented Aug 3, 2022

Consider the following code, written on a Jupyter notebook:

using ArgParse

function parse_commandline()
    s = ArgParseSettings()
    @add_arg_table s begin
        "arg1"
            help     = "learning rate"
            default  = 0.001

        "arg2"
            help     = "minibatch size for dataloader"
            default  = 1

        "arg3"
            help     = "number of epochs"
            default  = 10
    end

    return parse_args(ARGS, s)
end

parsed_args = parse_commandline()

When executed correctly, it gives the following reply:

Dict{String, Any} with 3 entries:
  "arg1" => 0.001
  "arg2" => 1
  "arg3" => 10

I have two computers running latest Ubuntu 20.04 and Julia 1.6.7, presenting very adverse results:

  • On REPL, both execute the code correctly;
  • On VS-Code, PC-A runs the code correctly, but PC-B does not;
  • On Anaconda Jupyter, PC-B runs the code with failure, whilst PC-A does not.

Whenever failure occurs, output is as follows:

Dict{String, Any} with 3 entries:
  "arg1" => "/home/myuser/.local/share/jupyter/runtime/kernel-v2-1571XvxDGHmL0T9W…
  "arg2" => 1
  "arg3" => 10

Despite extensive effort, could not find the cause and fix it.

Any advise is appreciated. Thanks.

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

1 participant