lua - invalid argument type

Alejandro Simkievich

I am a newbie to Lua. Currently getting the following error message:

invalid argument type for argument -model (should be the model checkpoint 
to use for sampling)
Usage: [options] <model>

I am sure it is something pretty easy to solve, but cannot manage to find the solution.

The 'model' is a file lm_checkpoint_epoch50.00_2.7196.t7, which is in the directory

/home/ubuntu/xxx/nn/cv

I am running the program from the parent directory (/home/ubuntu/xxx/nn)

I have tried out the following options to run the program (from one directory above the one the model is saved):

th sample.lua - model lm_chelm_checkpoint_epoch50.00_2.5344.t7
th sample.lua lm_chelm_checkpoint_epoch50.00_2.5344.t7
th sample.lua /cv/lm_chelm_checkpoint_epoch50.00_2.5344.t7
th sample.lua - /cv/model lm_chelm_checkpoint_epoch50.00_2.5344.t7

Also, the program has a torch.CmdLine() object where :argument equals '/cv/lm_checkpoint_epoch50.00_2.7196.t7'. The program prints the parameters, so that you see the following output on the screen:

Options
<model>      /cv/lm_checkpoint_epoch50.00_2.7196.t7

so it finds a value for argument 'model', which is picked up from the .lua file, not the parameter in the command line. This file is a valid mode.

Pretty lost, hope someone relates to this issue. Thanks.

Alejandro Simkievich

found the issue - it was a bug as smhx suggested. I inadvertently changed the source code from:

require 'torch'
cmd = torch.CmdLine()
cmd:argument('-model','model checkpoint to use for sampling')

Note that there is no argument in the source code. To:

cmd:argument('-model','/cv/model lm_chelm_checkpoint_epoch50.00_2.5344.t7'
'model checkpoint to use for sampling')

So the argument must be passed through the command line, not the source code. With parameters, it is different - you can include them in the source code.

So if I change back the source code and run the following from the command line:

th sample.lua cv/lm_chelm_checkpoint_epoch50.00_2.5344.t7

it works.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

invalid type argument of ‘->’

From Dev

invalid type argument of '->' C

From Dev

Argument type varchar invalid

From Dev

invalid type argument of '->'

From Dev

invalid 'type' (character) of argument

From Dev

invalid type argument of ‘->’ (have ‘color’)

From Dev

error: invalid type argument of unary '*'

From Dev

error: invalid type argument of unary '*'

From Dev

error: invalid type argument of 'unary *' (have 'int')|

From Dev

error: invalid type argument of ‘->’ (have ‘int’)

From Dev

Getting "invalid 'type' (character) of argument" error with aggregate()

From Dev

R: Error says invalid 'type' (character) of argument

From Dev

#define and invalid type argument of unary ‘*’ (have ‘double’)

From Dev

Using Table to Group: invalid 'type' (character) of argument

From Dev

Invalid type argument of '*' (have 'double') C

From Dev

Missing or invalid type argument for pointer action - Selenium

From Dev

invalid 'envir' argument of type 'closure' in R shiny

From Dev

UPDATE error: "Argument data type text is invalid for argument 1 of REPLACE"

From Dev

SQL Argument data type int is invalid for argument 1 of charindex function

From Dev

"Argument data type ntext is invalid for argument 1 of len function" error

From Dev

"invalid use of incomplete type" for const function pointer type as template argument

From Dev

Tensorflow TypeError: Fetch argument None has invalid type <type 'NoneType'>?

From Dev

"invalid use of incomplete type" for const function pointer type as template argument

From Dev

.: createDirectory: invalid argument (Invalid argument)

From Dev

Sum of returned list: Error: invalid 'type' (list) of argument

From Dev

error creating chisq.test() in R - invalid 'type' (character) of argument

From Dev

Error in read.table: !header: invalid argument type

From Dev

Conflicting types error and invalid type argument of unary * have int

From Dev

Probably easy to fix: Invalid argument type 'void' to unary expression

Related Related

  1. 1

    invalid type argument of ‘->’

  2. 2

    invalid type argument of '->' C

  3. 3

    Argument type varchar invalid

  4. 4

    invalid type argument of '->'

  5. 5

    invalid 'type' (character) of argument

  6. 6

    invalid type argument of ‘->’ (have ‘color’)

  7. 7

    error: invalid type argument of unary '*'

  8. 8

    error: invalid type argument of unary '*'

  9. 9

    error: invalid type argument of 'unary *' (have 'int')|

  10. 10

    error: invalid type argument of ‘->’ (have ‘int’)

  11. 11

    Getting "invalid 'type' (character) of argument" error with aggregate()

  12. 12

    R: Error says invalid 'type' (character) of argument

  13. 13

    #define and invalid type argument of unary ‘*’ (have ‘double’)

  14. 14

    Using Table to Group: invalid 'type' (character) of argument

  15. 15

    Invalid type argument of '*' (have 'double') C

  16. 16

    Missing or invalid type argument for pointer action - Selenium

  17. 17

    invalid 'envir' argument of type 'closure' in R shiny

  18. 18

    UPDATE error: "Argument data type text is invalid for argument 1 of REPLACE"

  19. 19

    SQL Argument data type int is invalid for argument 1 of charindex function

  20. 20

    "Argument data type ntext is invalid for argument 1 of len function" error

  21. 21

    "invalid use of incomplete type" for const function pointer type as template argument

  22. 22

    Tensorflow TypeError: Fetch argument None has invalid type <type 'NoneType'>?

  23. 23

    "invalid use of incomplete type" for const function pointer type as template argument

  24. 24

    .: createDirectory: invalid argument (Invalid argument)

  25. 25

    Sum of returned list: Error: invalid 'type' (list) of argument

  26. 26

    error creating chisq.test() in R - invalid 'type' (character) of argument

  27. 27

    Error in read.table: !header: invalid argument type

  28. 28

    Conflicting types error and invalid type argument of unary * have int

  29. 29

    Probably easy to fix: Invalid argument type 'void' to unary expression

HotTag

Archive