{ "cells": [ { "cell_type": "markdown", "source": [ "# Training mode\n", "\n", "Task training mode offers flexibility in task training, testing and prediction. By default, nesting and cross-validation are active." ], "metadata": { "collapsed": false } }, { "cell_type": "code", "execution_count": 9, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[\u001B[36m2024-01-17 15:29:36,209\u001B[0m][\u001B[34mmml\u001B[0m][\u001B[32mINFO\u001B[0m] - Started MML 0.12.0 on Python 3.8.13 with mode TRAIN.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,209\u001B[0m][\u001B[34mmml\u001B[0m][\u001B[32mINFO\u001B[0m] - Plugins loaded: ['mml-tasks', 'mml-tags', 'mml-dimensionality', 'mml-inference', 'mml-sql', 'mml-similarity']\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,355\u001B[0m][\u001B[34mmml.core.scripts.schedulers.base_scheduler\u001B[0m][\u001B[32mINFO\u001B[0m] - Pivot task is \u001B[33m\u001B[46m\u001B[1mmml_fake_task\u001B[0m.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,361\u001B[0m][\u001B[34mpy.warnings\u001B[0m][\u001B[33mWARNING\u001B[0m] - /home/scholzpa/Documents/development/gitlab/mml/src/mml/core/scripts/schedulers/train_scheduler.py:99: UserWarning: Cross-Validation will store 5 model parameters. To reduce memory consumption you may consider either setting mode.store_parameters=false (which will omit storing the model parameters) or reuse.clean_up.parameters=true (which deletes the model parameters at the end of the experiment.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,361\u001B[0m][\u001B[34mmml\u001B[0m][\u001B[32mINFO\u001B[0m] - MML init time was 0.0h 0.0m 0.15s.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,362\u001B[0m][\u001B[34mmml.core.scripts.schedulers.base_scheduler\u001B[0m][\u001B[32mINFO\u001B[0m] - Preparing experiment ...\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,366\u001B[0m][\u001B[34mmml.core.scripts.schedulers.base_scheduler\u001B[0m][\u001B[32mINFO\u001B[0m] - Starting experiment!\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,367\u001B[0m][\u001B[34mmml.core.scripts.schedulers.train_scheduler\u001B[0m][\u001B[32mINFO\u001B[0m] - Starting training for task \u001B[33m\u001B[46m\u001B[1mmml_fake_task+nested?0\u001B[0m and fold 0.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,802\u001B[0m][\u001B[34mtimm.models._builder\u001B[0m][\u001B[32mINFO\u001B[0m] - Loading pretrained weights from Hugging Face hub (timm/resnet34.a1_in1k)\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:36,984\u001B[0m][\u001B[34mtimm.models._hub\u001B[0m][\u001B[32mINFO\u001B[0m] - [timm/resnet34.a1_in1k] Safe alternative available for 'pytorch_model.bin' (as 'model.safetensors'). Loading weights using safetensors.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:37,011\u001B[0m][\u001B[34mmml.core.models.lightning_single_frame\u001B[0m][\u001B[32mINFO\u001B[0m] - Since sampling is unbalanced will try to auto activate loss weights for classes.\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:37,283\u001B[0m][\u001B[34mlightning_fabric.utilities.rank_zero\u001B[0m][\u001B[32mINFO\u001B[0m] - Using 16bit Automatic Mixed Precision (AMP)\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:37,292\u001B[0m][\u001B[34mlightning_fabric.utilities.rank_zero\u001B[0m][\u001B[32mINFO\u001B[0m] - GPU available: True (cuda), used: True\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:37,292\u001B[0m][\u001B[34mlightning_fabric.utilities.rank_zero\u001B[0m][\u001B[32mINFO\u001B[0m] - TPU available: False, using: 0 TPU cores\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:37,292\u001B[0m][\u001B[34mlightning_fabric.utilities.rank_zero\u001B[0m][\u001B[32mINFO\u001B[0m] - IPU available: False, using: 0 IPUs\u001B[0m\r\n", "[\u001B[36m2024-01-17 15:29:37,292\u001B[0m][\u001B[34mlightning_fabric.utilities.rank_zero\u001B[0m][\u001B[32mINFO\u001B[0m] - HPU available: False, using: 0 HPUs\u001B[0m\r\n", "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\r\n", "\r\n", " | Name | Type | Params\r\n", "---------------------------------------------------\r\n", "0 | model | TimmGenericModel | 21.3 M\r\n", "1 | criteria | ModuleDict | 0 \r\n", "2 | train_metrics | ModuleDict | 0 \r\n", "3 | val_metrics | ModuleDict | 0 \r\n", "4 | test_metrics | ModuleDict | 0 \r\n", "5 | train_cms | ModuleDict | 0 \r\n", "6 | val_cms | ModuleDict | 0 \r\n", "7 | test_cms | ModuleDict | 0 \r\n", "---------------------------------------------------\r\n", "21.3 M Trainable params\r\n", "0 Non-trainable params\r\n", "21.3 M Total params\r\n", "85.159 Total estimated model params size (MB)\r\n", "[\u001B[36m2024-01-17 15:29:37,690\u001B[0m][\u001B[34mpy.warnings\u001B[0m][\u001B[33mWARNING\u001B[0m] - /home/scholzpa/miniconda3/envs/mml/lib/python3.8/site-packages/lightning/pytorch/loops/fit_loop.py:293: The number of training batches (3) is smaller than the logging interval Trainer(log_every_n_steps=50). Set a lower value for log_every_n_steps if you want to see logs for the training epoch.\u001B[0m\r\n", "Epoch 0: 100%|██████| 3/3 [00:03<00:00, 0.84it/s, v_num=9-36, train/loss=2.360]\r\n", "Validation: | | 0/? [00:00>> tensorboard --logdir path/to/MML_RESULTS/DEMO2\n", ">>> Open browser -> http://localhost:6006\n" ], "metadata": { "collapsed": false } }, { "cell_type": "code", "execution_count": null, "outputs": [], "source": [], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }