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

Revert TrainType typo #1928

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Unlike other tasks, ``--val-data-root`` is not needed.
$ otx train otx/algorithms/classification/configs/efficientnet_b0_cls_incr/template.yaml \
--train-data-root=tests/assets/imagenet_dataset_class_incremental \
params \
--algo_backend.train_type=SELFSUPERVISED
--algo_backend.train_type=Selfsupervised

After self-supervised training, pretrained weights can be use for supervised (incremental) learning like the below command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ To enable self-supervised training, the command below can be executed:
$ otx train otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/template.yaml \
--train-data-roots=tests/assets/common_semantic_segmentation_dataset/train/images \
params \
--algo_backend.train_type=SELFSUPERVISED
--algo_backend.train_type=Selfsupervised

After self-supervised training, pretrained weights can be use for supervised (incremental) learning like the below command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Building workspace folder
Comma-separated paths to unlabeled file list
--task TASK The currently supported options: ('CLASSIFICATION', 'DETECTION', 'INSTANCE_SEGMENTATION', 'SEGMENTATION', 'ACTION_CLASSIFICATION', 'ACTION_DETECTION', 'ANOMALY_CLASSIFICATION', 'ANOMALY_DETECTION', 'ANOMALY_SEGMENTATION').
--train-type TRAIN_TYPE
The currently supported options: dict_keys(['INCREMENTAL', 'SEMISUPERVISED', 'SELFSUPERVISED']).
The currently supported options: dict_keys(['Incremental', 'Semisupervised', 'Selfsupervised']).
--work-dir WORK_DIR Location where the workspace.
--model MODEL Enter the name of the model you want to use. (Ex. EfficientNet-B0).
--backbone BACKBONE Available Backbone Type can be found using 'otx find --backbone {framework}'.
Expand Down Expand Up @@ -181,7 +181,7 @@ However, if you created a workspace with ``otx build``, the training process can
--unlabeled-file-list UNLABELED_FILE_LIST
Comma-separated paths to unlabeled file list
--train-type TRAIN_TYPE
The currently supported options: dict_keys(['INCREMENTAL', 'SEMISUPERVISED', 'SELFSUPERVISED']).
The currently supported options: dict_keys(['Incremental', 'Semisupervised', 'Selfsupervised']).
--load-weights LOAD_WEIGHTS
Load model weights from previously saved checkpoint.
--resume-from RESUME_FROM
Expand Down
30 changes: 15 additions & 15 deletions docs/source/guide/tutorials/advanced/self_sl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ for **self-supervised learning** by running the following command:

.. code-block::

(otx) ...$ otx build --train-data-roots data/flower_photos --model MobileNet-V3-large-1x --train-type SELFSUPERVISED --work-dir otx-workspace-CLASSIFICATION-SELFSUPERVISED
(otx) ...$ otx build --train-data-roots data/flower_photos --model MobileNet-V3-large-1x --train-type Selfsupervised --work-dir otx-workspace-CLASSIFICATION-Selfsupervised

[*] Workspace Path: otx-workspace-CLASSIFICATION-SELFSUPERVISED
[*] Workspace Path: otx-workspace-CLASSIFICATION-Selfsupervised
[*] Load Model Template ID: Custom_Image_Classification_MobileNet-V3-large-1x
[*] Load Model Name: MobileNet-V3-large-1x[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/selfsl/model.py
[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/selfsl/data_pipeline.py
[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/deployment.py
[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/hpo_config.yaml
[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/model_hierarchical.py
[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/model_multilabel.py
[*] Update data configuration file to: otx-workspace-CLASSIFICATION-SELFSUPERVISED/data.yaml
[*] Load Model Name: MobileNet-V3-large-1x[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/selfsl/model.py
[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/selfsl/data_pipeline.py
[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/deployment.py
[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/hpo_config.yaml
[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/model_hierarchical.py
[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/model_multilabel.py
[*] Update data configuration file to: otx-workspace-CLASSIFICATION-Selfsupervised/data.yaml

.. note::

Three things must be considered to set the workspace for self-supervised learning:

1. add ``--train-type SELFSUPERVISED`` in the command to get the training components for self-supervised learning,
1. add ``--train-type Selfsupervised`` in the command to get the training components for self-supervised learning,
2. update the path set as ``train-data-roots``,
3. and add ``--work-dir`` to distinguish self-supervised learning workspace from supervised learning workspace.

Expand All @@ -102,7 +102,7 @@ After the workspace creation, the workspace structure is as follows:
│   ├── train
│   └── val
└── template.yaml
otx-workspace-CLASSIFICATION-SELFSUPERVISED
otx-workspace-CLASSIFICATION-Selfsupervised
├── configuration.yaml
├── data.yaml
├── deployment.py
Expand All @@ -121,20 +121,20 @@ After the workspace creation, the workspace structure is as follows:
For `VOC2012 dataset <http://host.robots.ox.ac.uk/pascal/VOC/voc2012>`_ used in :doc:`semantic segmentation tutorial <../base/how_to_train/semantic_segmentation>`, for example, the path ``data/VOCdevkit/VOC2012/JPEGImages`` must be set instead of ``data/VOCdevkit/VOC2012``.

Please refer to :ref:`Explanation of Self-Supervised Learning for Semantic Segmentation <selfsl_semantic_segmentation>`.
And don't forget to add ``--train-type SELFSUPERVISED``.
And don't forget to add ``--train-type Selfsupervised``.

.. code-block::

(otx) ...$ otx build --train-data-roots data/VOCdevkit/VOC2012/JPEGImages \
--model Lite-HRNet-18-mod2 \
--train-type SELFSUPERVISED
--train-type Selfsupervised

4. To start training we need to call ``otx train``
command in **self-supervised learning** workspace:

.. code-block::

(otx) ...$ cd otx-workspace-CLASSIFICATION-SELFSUPERVISED
(otx) ...$ cd otx-workspace-CLASSIFICATION-Selfsupervised
(otx) ...$ otx train --data ../otx-workspace-CLASSIFICATION/data.yaml

...
Expand Down Expand Up @@ -168,7 +168,7 @@ After pre-training progress, start fine-tuning by calling the below command with
.. code-block::

(otx) ...$ cd ../otx-workspace-CLASSIFICATION
(otx) ...$ otx train --load-weights ../otx-workspace-CLASSIFICATION-SELFSUPERVISED/models/weights.pth
(otx) ...$ otx train --load-weights ../otx-workspace-CLASSIFICATION-Selfsupervised/models/weights.pth

...

Expand Down
18 changes: 9 additions & 9 deletions docs/source/guide/tutorials/advanced/semi_sl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Enable via ``otx build``
1. To enable semi-supervsied learning via ``otx build``, we need to add arguments ``--unlabeled-data-roots`` and ``--train-type``.
OpenVINO™ Training Extensions receives the root path where unlabeled images are by ``--unlabeled-data-roots``.

We should put the path where unlabeled data are contained. It also provides us ``--train-type`` to select the type of training scheme. All we have to do for that is specifying it as **SEMISUPERVISED**.
We should put the path where unlabeled data are contained. It also provides us ``--train-type`` to select the type of training scheme. All we have to do for that is specifying it as **Semisupervised**.

.. note::

Expand All @@ -85,7 +85,7 @@ We should put the path where unlabeled data are contained. It also provides us `

.. code-block::

(otx) ...$ otx build --train-data-roots data/flower_photos --unlabeled-data-roots tests/assets/imagenet_dataset --model MobileNet-V3-large-1x --train-type SEMISUPERVISED
(otx) ...$ otx build --train-data-roots data/flower_photos --unlabeled-data-roots tests/assets/imagenet_dataset --model MobileNet-V3-large-1x --train-type Semisupervised


[*] Workspace Path: otx-workspace-CLASSIFICATION
Expand All @@ -107,14 +107,14 @@ command in our workspace:

(otx) ...$ otx train

In the train log, you can check that the train type is set to **SEMISUPERVISED** and related configurations are properly loaded as following:
In the train log, you can check that the train type is set to **Semisupervised** and related configurations are properly loaded as following:

.. code-block::

...
2023-02-22 06:21:54,492 | INFO : called _init_recipe()
2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED
2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED - loading training_extensions/otx/recipes/stages/classification/semisl.yaml
2023-02-22 06:21:54,492 | INFO : train type = Semisupervised
2023-02-22 06:21:54,492 | INFO : train type = Semisupervised - loading training_extensions/otx/recipes/stages/classification/semisl.yaml
2023-02-22 06:21:54,500 | INFO : Replacing runner from EpochRunnerWithCancel to EpochRunnerWithCancel.
2023-02-22 06:21:54,503 | INFO : initialized recipe = training_extensions/otx/recipes/stages/classification/semisl.yaml
...
Expand All @@ -135,16 +135,16 @@ which is one of template-specific parameters (details are provided in `quick sta
(otx) ...$ otx train otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/template.yaml \
--train-data-roots data/flower_photos \
--unlabeled-data-roots tests/assets/imagenet_dataset \
params --algo_backend.train_type SEMISUPERVISED
params --algo_backend.train_type Semisupervised

In the train log, you can check that the train type is set to **SEMISUPERVISED** and related configurations are properly loaded as following:
In the train log, you can check that the train type is set to **Semisupervised** and related configurations are properly loaded as following:

.. code-block::

...
2023-02-22 06:21:54,492 | INFO : called _init_recipe()
2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED
2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED - loading training_extensions/otx/recipes/stages/classification/semisl.yaml
2023-02-22 06:21:54,492 | INFO : train type = Semisupervised
2023-02-22 06:21:54,492 | INFO : train type = Semisupervised - loading training_extensions/otx/recipes/stages/classification/semisl.yaml
2023-02-22 06:21:54,500 | INFO : Replacing runner from EpochRunnerWithCancel to EpochRunnerWithCancel.
2023-02-22 06:21:54,503 | INFO : initialized recipe = training_extensions/otx/recipes/stages/classification/semisl.yaml
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,20 @@ algo_backend:
header: Algo backend parameters
train_type:
affects_outcome_of: NONE
default_value: INCREMENTAL
default_value: Incremental
description: Quantization preset that defines quantization scheme
editable: false
enum_name: TrainType
header: Train type
options:
INCREMENTAL: "INCREMENTAL"
Incremental: "Incremental"
type: SELECTABLE
ui_rules:
action: DISABLE_EDITING
operator: AND
rules: []
type: UI_RULES
value: INCREMENTAL
value: Incremental
visible_in_ui: True
warning: null
mem_cache_size:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ hyper_parameters:
default_value: 1.0
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ hyper_parameters:
default_value: 1.0
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
6 changes: 3 additions & 3 deletions otx/algorithms/action/configs/detection/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,20 @@ algo_backend:
header: Algo backend parameters
train_type:
affects_outcome_of: NONE
default_value: INCREMENTAL
default_value: Incremental
description: Quantization preset that defines quantization scheme
editable: false
enum_name: TrainType
header: Train type
options:
INCREMENTAL: "INCREMENTAL"
Incremental: "Incremental"
type: SELECTABLE
ui_rules:
action: DISABLE_EDITING
operator: AND
rules: []
type: UI_RULES
value: INCREMENTAL
value: Incremental
visible_in_ui: True
warning: null
mem_cache_size:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ hyper_parameters:
default_value: 1.0
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
10 changes: 5 additions & 5 deletions otx/algorithms/classification/configs/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,22 +336,22 @@ algo_backend:
header: Algo backend parameters
train_type:
affects_outcome_of: TRAINING
default_value: INCREMENTAL
default_value: Incremental
description: Training scheme option that determines how to train the model
editable: True
enum_name: TrainType
header: Train type
options:
INCREMENTAL: "INCREMENTAL"
SEMISUPERVISED: "SEMISUPERVISED"
SELFSUPERVISED: "SELFSUPERVISED"
Incremental: "Incremental"
Semisupervised: "Semisupervised"
Selfsupervised: "Selfsupervised"
type: SELECTABLE
ui_rules:
action: DISABLE_EDITING
operator: AND
rules: []
type: UI_RULES
value: INCREMENTAL
value: Incremental
visible_in_ui: True
warning: null
mem_cache_size:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hyper_parameters:
default_value: false
algo_backend:
train_type:
default_value: SELFSUPERVISED
default_value: Selfsupervised

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ hyper_parameters:
default_value: 90
algo_backend:
train_type:
default_value: SEMISUPERVISED
default_value: Semisupervised
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ hyper_parameters:
default_value: 1.0
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hyper_parameters:
default_value: false
algo_backend:
train_type:
default_value: SELFSUPERVISED
default_value: Selfsupervised

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ hyper_parameters:
default_value: 90
algo_backend:
train_type:
default_value: SEMISUPERVISED
default_value: Semisupervised
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ hyper_parameters:
default_value: 1.0
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hyper_parameters:
default_value: false
algo_backend:
train_type:
default_value: SELFSUPERVISED
default_value: Selfsupervised

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hyper_parameters:
default_value: 20
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hyper_parameters:
default_value: false
algo_backend:
train_type:
default_value: SELFSUPERVISED
default_value: Selfsupervised

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ hyper_parameters:
default_value: 90
algo_backend:
train_type:
default_value: SEMISUPERVISED
default_value: Semisupervised
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ hyper_parameters:
default_value: 1.0
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hyper_parameters:
default_value: false
algo_backend:
train_type:
default_value: SELFSUPERVISED
default_value: Selfsupervised

# Training resources.
max_nodes: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hyper_parameters:
default_value: 20
algo_backend:
train_type:
default_value: INCREMENTAL
default_value: Incremental

# Training resources.
max_nodes: 1
Expand Down
Loading