|
164 | 164 | " \"$import os\",\n",
|
165 | 165 | " \"$import ignite\"\n",
|
166 | 166 | " ],\n",
|
167 |
| - " \"determinism\": \"$monai.utils.set_determinism(seed=123)\",\n", |
168 |
| - " \"cudnn_opt\": \"$setattr(torch.backends.cudnn, 'benchmark', True)\",\n", |
169 | 167 | " \"device\": \"$torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\",\n",
|
170 | 168 | " \"ckpt_path\": \"/workspace/data/models/model.pt\",\n",
|
171 | 169 | " \"dataset_dir\": \"/workspace/data/Task09_Spleen\",\n",
|
|
513 | 511 | "\n",
|
514 | 512 | "There are several predefined scripts in MONAI bundle module to help execute `regular training`, `metadata verification base on schema`, `network input / output verification`, `export to TorchScript model`, etc.\n",
|
515 | 513 | "\n",
|
516 |
| - "Here we leverage the `run` script and specify the ID of trainer in the config." |
| 514 | + "Here we leverage the `run` script and specify the ID of trainer in the config.\n", |
| 515 | + "\n", |
| 516 | + "Just define the entry point expressions in the config to execute in order, and specify the `runner_id` in CLI script." |
| 517 | + ] |
| 518 | + }, |
| 519 | + { |
| 520 | + "cell_type": "markdown", |
| 521 | + "metadata": {}, |
| 522 | + "source": [ |
| 523 | + "```json\n", |
| 524 | + "\"training\": [\n", |
| 525 | + " \"$monai.utils.set_determinism(seed=123)\",\n", |
| 526 | + " \"$setattr(torch.backends.cudnn, 'benchmark', True)\",\n", |
| 527 | + " \"$@train#trainer.run()\"\n", |
| 528 | + "]\n", |
| 529 | + "```" |
517 | 530 | ]
|
518 | 531 | },
|
519 | 532 | {
|
520 | 533 | "cell_type": "markdown",
|
521 | 534 | "metadata": {},
|
522 | 535 | "source": [
|
523 |
| - "`python -m monai.bundle run \"'train#trainer'\" --config_file configs/train.json`" |
| 536 | + "`python -m monai.bundle run training --config_file configs/train.json`" |
524 | 537 | ]
|
525 | 538 | },
|
526 | 539 | {
|
|
538 | 551 | "cell_type": "markdown",
|
539 | 552 | "metadata": {},
|
540 | 553 | "source": [
|
541 |
| - "`python -m monai.bundle run \"'train#trainer'\" --config_file configs/train.json --device \"\\$torch.device('cuda:1')\"`" |
| 554 | + "`python -m monai.bundle run training --config_file configs/train.json --device \"\\$torch.device('cuda:1')\"`" |
542 | 555 | ]
|
543 | 556 | },
|
544 | 557 | {
|
|
552 | 565 | "cell_type": "markdown",
|
553 | 566 | "metadata": {},
|
554 | 567 | "source": [
|
555 |
| - "`python -m monai.bundle run \"'train#trainer'\" --config_file configs/train.json --network \"%configs/test.json#network\"`" |
| 568 | + "`python -m monai.bundle run training --config_file configs/train.json --network \"%configs/test.json#network\"`" |
556 | 569 | ]
|
557 | 570 | },
|
558 | 571 | {
|
|
0 commit comments