Skip to content

Commit 366a1b0

Browse files
yoshiyukinakaiJen Person
and
Jen Person
authored
Resolve DeprecationWarning messages (#890)
The following warnings were shown when running mnist-node example. (node:2231947) DeprecationWarning: ArgumentParser(): following options are renamed: 'addHelp' -> 'add_help' (node:2231947) DeprecationWarning: _ActionsContainer.addArgument() is renamed to _ActionsContainer.add_argument() (node:2231947) DeprecationWarning: add_argument(): following options are renamed: 'defaultValue' -> 'default' (node:2231947) DeprecationWarning: ArgumentParser.parseArgs() is renamed to ArgumentParser.parse_args() Co-authored-by: Jen Person <[email protected]>
1 parent 41b0262 commit 366a1b0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mnist-node/main.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,22 @@ async function run(epochs, batchSize, modelSavePath) {
5656

5757
const parser = new argparse.ArgumentParser({
5858
description: 'TensorFlow.js-Node MNIST Example.',
59-
addHelp: true
59+
add_help: true
6060
});
61-
parser.addArgument('--epochs', {
61+
parser.add_argument('--epochs', {
6262
type: 'int',
63-
defaultValue: 20,
63+
default: 20,
6464
help: 'Number of epochs to train the model for.'
6565
});
66-
parser.addArgument('--batch_size', {
66+
parser.add_argument('--batch_size', {
6767
type: 'int',
68-
defaultValue: 128,
68+
default: 128,
6969
help: 'Batch size to be used during model training.'
7070
})
71-
parser.addArgument('--model_save_path', {
71+
parser.add_argument('--model_save_path', {
7272
type: 'string',
7373
help: 'Path to which the model will be saved after training.'
7474
});
75-
const args = parser.parseArgs();
75+
const args = parser.parse_args();
7676

7777
run(args.epochs, args.batch_size, args.model_save_path);

0 commit comments

Comments
 (0)