Created
May 4, 2022 04:15
-
-
Save jph00/921929bb63ecb0f4802355f4b9f14156 to your computer and use it in GitHub Desktop.
timm vs tvm fine tuning 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"metadata": {}, | |
"id": "7195af18", | |
"cell_type": "markdown", | |
"source": "# timm vs tvm fine-tuning" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"id": "44eb0ad3", | |
"cell_type": "code", | |
"source": "#|export\nfrom fastai.vision.all import *", | |
"execution_count": 1, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "from timm.data import resolve_data_config\nfrom timm.data.transforms_factory import create_transform\ntransform = create_transform(**(resolve_data_config({}, model='resnet101')))", | |
"execution_count": 76, | |
"outputs": [] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "# Fit head" | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true | |
}, | |
"cell_type": "markdown", | |
"source": "## rn101" | |
}, | |
{ | |
"metadata": { | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "dls = ImageDataLoaders.from_name_func('.',\n get_image_files(path), valid_pct=0.2, seed=42,\n label_func=RegexLabeller(pat = r'^([^/]+)_\\d+'),\n item_tfms=Resize(256, resamples=(Image.BICUBIC, 0)))", | |
"execution_count": 60, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### tvm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet101, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 61, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.497890</td>\n <td>0.207686</td>\n <td>0.067659</td>\n <td>00:21</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet101, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 62, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.497349</td>\n <td>0.232913</td>\n <td>0.077808</td>\n <td>00:21</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet101, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 63, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.500917</td>\n <td>0.246624</td>\n <td>0.079838</td>\n <td>00:21</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### timm 101d" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet101d', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 64, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.576971</td>\n <td>0.283662</td>\n <td>0.086604</td>\n <td>00:23</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet101d', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 65, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.593215</td>\n <td>0.244281</td>\n <td>0.070365</td>\n <td>00:22</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet101d', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 66, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.542534</td>\n <td>0.252017</td>\n <td>0.077808</td>\n <td>00:22</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### timm 101" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet101', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 67, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "Downloading: \"https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-rsb-weights/resnet101_a1h-36d3f2aa.pth\" to /home/jhoward/.cache/torch/hub/checkpoints/resnet101_a1h-36d3f2aa.pth\n", | |
"name": "stderr" | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.610411</td>\n <td>0.286365</td>\n <td>0.081867</td>\n <td>00:21</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet101', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 68, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.630459</td>\n <td>0.305501</td>\n <td>0.097429</td>\n <td>00:21</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet101', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 69, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.658470</td>\n <td>0.306474</td>\n <td>0.091340</td>\n <td>00:21</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true | |
}, | |
"cell_type": "markdown", | |
"source": "## rn50" | |
}, | |
{ | |
"metadata": { | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "path = untar_data(URLs.PETS)/'images'\n\ndls = ImageDataLoaders.from_name_func('.',\n get_image_files(path), valid_pct=0.2, seed=42,\n label_func=RegexLabeller(pat = r'^([^/]+)_\\d+'),\n item_tfms=Resize(224, resamples=(Image.BICUBIC, 0)))", | |
"execution_count": 42, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### tvm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet50, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 49, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.544672</td>\n <td>0.258608</td>\n <td>0.080514</td>\n <td>00:11</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet50, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 50, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.534701</td>\n <td>0.282513</td>\n <td>0.087280</td>\n <td>00:11</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet50, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 51, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.531820</td>\n <td>0.271013</td>\n <td>0.081191</td>\n <td>00:12</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### timm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet50', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 52, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.829267</td>\n <td>0.389983</td>\n <td>0.118403</td>\n <td>00:11</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet50', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 53, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.839080</td>\n <td>0.358798</td>\n <td>0.112991</td>\n <td>00:11</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet50', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 54, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.831657</td>\n <td>0.398889</td>\n <td>0.117050</td>\n <td>00:11</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true | |
}, | |
"cell_type": "markdown", | |
"source": "## rn34" | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### tvm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet34, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 29, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.798315</td>\n <td>0.302830</td>\n <td>0.095399</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet34, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 30, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.781264</td>\n <td>0.278228</td>\n <td>0.081867</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet34, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 31, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.785211</td>\n <td>0.294066</td>\n <td>0.095399</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### timm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet34', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 32, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.017067</td>\n <td>0.354393</td>\n <td>0.121786</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet34', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 33, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.036802</td>\n <td>0.345934</td>\n <td>0.114344</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet34', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 34, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.003281</td>\n <td>0.355012</td>\n <td>0.112314</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true | |
}, | |
"cell_type": "markdown", | |
"source": "## rn18" | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### tvm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 35, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.909001</td>\n <td>0.371506</td>\n <td>0.121110</td>\n <td>00:05</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 36, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.901344</td>\n <td>0.340783</td>\n <td>0.108254</td>\n <td>00:05</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\nlearn.fit(1)", | |
"execution_count": 37, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.889893</td>\n <td>0.351600</td>\n <td>0.119756</td>\n <td>00:05</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true, | |
"hidden": true | |
}, | |
"cell_type": "markdown", | |
"source": "### timm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet18', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 38, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.912840</td>\n <td>0.330604</td>\n <td>0.102842</td>\n <td>00:05</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet18', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 39, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.904940</td>\n <td>0.333232</td>\n <td>0.107578</td>\n <td>00:05</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet18', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fit(1)", | |
"execution_count": 40, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.894111</td>\n <td>0.346396</td>\n <td>0.109608</td>\n <td>00:05</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "# Fine tune" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## rn34" | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true | |
}, | |
"cell_type": "markdown", | |
"source": "### tvm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": false, | |
"hidden": true | |
}, | |
"id": "7ec6bf20", | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet34, metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 7, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.509213</td>\n <td>0.356186</td>\n <td>0.112314</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.455695</td>\n <td>0.331886</td>\n <td>0.100135</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.213132</td>\n <td>0.276668</td>\n <td>0.080514</td>\n <td>00:08</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": false, | |
"hidden": true | |
}, | |
"id": "e8f981b2", | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet34, metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 9, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.502705</td>\n <td>0.400162</td>\n <td>0.129229</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.445414</td>\n <td>0.356927</td>\n <td>0.119756</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.253193</td>\n <td>0.303988</td>\n <td>0.089986</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.101743</td>\n <td>0.260026</td>\n <td>0.079838</td>\n <td>00:08</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": false, | |
"hidden": true | |
}, | |
"id": "a6a3da68", | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet34, metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 10, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.493860</td>\n <td>0.374025</td>\n <td>0.123139</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.463749</td>\n <td>0.360396</td>\n <td>0.112314</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.249122</td>\n <td>0.262384</td>\n <td>0.080514</td>\n <td>00:09</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.092573</td>\n <td>0.250281</td>\n <td>0.080514</td>\n <td>00:09</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"heading_collapsed": true | |
}, | |
"id": "18d44fd6", | |
"cell_type": "markdown", | |
"source": "### timm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"id": "22b41c39", | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet34', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.690105</td>\n <td>0.487829</td>\n <td>0.167118</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.551655</td>\n <td>0.402820</td>\n <td>0.131258</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.373971</td>\n <td>0.329160</td>\n <td>0.103518</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.238675</td>\n <td>0.327382</td>\n <td>0.103518</td>\n <td>00:08</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true, | |
"hidden": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet34', metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 9, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.740627</td>\n <td>0.471054</td>\n <td>0.161028</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.538780</td>\n <td>0.372956</td>\n <td>0.129229</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.374607</td>\n <td>0.322019</td>\n <td>0.110284</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.226970</td>\n <td>0.324621</td>\n <td>0.110961</td>\n <td>00:08</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": false, | |
"hidden": true | |
}, | |
"id": "18ef37cb", | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet34', metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 11, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.758452</td>\n <td>0.480506</td>\n <td>0.158999</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.560145</td>\n <td>0.377301</td>\n <td>0.130582</td>\n <td>00:09</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.358545</td>\n <td>0.320285</td>\n <td>0.107578</td>\n <td>00:08</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.234589</td>\n <td>0.303257</td>\n <td>0.102842</td>\n <td>00:09</td>\n </tr>\n </tbody>\n</table>", | |
"text/plain": "<IPython.core.display.HTML object>" | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## rn18" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### tvm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 70, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.491514</td>\n <td>0.355748</td>\n <td>0.121786</td>\n <td>00:06</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.454149</td>\n <td>0.306453</td>\n <td>0.098782</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.285463</td>\n <td>0.247489</td>\n <td>0.081191</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.151456</td>\n <td>0.233435</td>\n <td>0.073748</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 71, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.525481</td>\n <td>0.349106</td>\n <td>0.107578</td>\n <td>00:06</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.484882</td>\n <td>0.322500</td>\n <td>0.103518</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.294674</td>\n <td>0.229930</td>\n <td>0.071719</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.161957</td>\n <td>0.223818</td>\n <td>0.077131</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 72, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.550311</td>\n <td>0.379069</td>\n <td>0.117727</td>\n <td>00:06</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.446966</td>\n <td>0.336142</td>\n <td>0.115697</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.295696</td>\n <td>0.259633</td>\n <td>0.079838</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.150600</td>\n <td>0.234138</td>\n <td>0.075101</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### timm" | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet18', metrics=error_rate, zero_init_last_bn=False).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 73, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.498198</td>\n <td>0.396608</td>\n <td>0.129905</td>\n <td>00:06</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.491739</td>\n <td>0.285695</td>\n <td>0.093369</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.347889</td>\n <td>0.246741</td>\n <td>0.081191</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.257106</td>\n <td>0.236934</td>\n <td>0.075778</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet18', metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 74, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.530097</td>\n <td>0.348229</td>\n <td>0.107578</td>\n <td>00:06</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.462275</td>\n <td>0.312776</td>\n <td>0.103518</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.357109</td>\n <td>0.267156</td>\n <td>0.083221</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.264438</td>\n <td>0.244144</td>\n <td>0.083897</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "learn = vision_learner(dls, 'resnet18', metrics=error_rate).to_fp16()\nlearn.fine_tune(3)", | |
"execution_count": 75, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>1.523650</td>\n <td>0.353854</td>\n <td>0.112314</td>\n <td>00:06</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "\n<style>\n /* Turns off some styling */\n progress {\n /* gets rid of default border in Firefox and Opera. */\n border: none;\n /* Needs to be in here for Safari polyfill so background images work as expected. */\n background-size: auto;\n }\n .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n background: #F44336;\n }\n</style>\n" | |
}, | |
"metadata": {} | |
}, | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "<IPython.core.display.HTML object>", | |
"text/html": "<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: left;\">\n <th>epoch</th>\n <th>train_loss</th>\n <th>valid_loss</th>\n <th>error_rate</th>\n <th>time</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>0</td>\n <td>0.474876</td>\n <td>0.304399</td>\n <td>0.099459</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>1</td>\n <td>0.352838</td>\n <td>0.269430</td>\n <td>0.088633</td>\n <td>00:07</td>\n </tr>\n <tr>\n <td>2</td>\n <td>0.274900</td>\n <td>0.251792</td>\n <td>0.083221</td>\n <td>00:07</td>\n </tr>\n </tbody>\n</table>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "", | |
"execution_count": null, | |
"outputs": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3 (ipykernel)", | |
"language": "python" | |
}, | |
"language_info": { | |
"name": "python", | |
"version": "3.9.5", | |
"mimetype": "text/x-python", | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"pygments_lexer": "ipython3", | |
"nbconvert_exporter": "python", | |
"file_extension": ".py" | |
}, | |
"toc": { | |
"nav_menu": {}, | |
"number_sections": false, | |
"sideBar": true, | |
"skip_h1_title": false, | |
"base_numbering": 1, | |
"title_cell": "Table of Contents", | |
"title_sidebar": "Contents", | |
"toc_cell": false, | |
"toc_position": {}, | |
"toc_section_display": true, | |
"toc_window_display": false | |
}, | |
"gist": { | |
"id": "2e025ecff56620fdcc1966b788f85b72", | |
"data": { | |
"description": "timm vs tvm fine tuning 2", | |
"public": true | |
} | |
}, | |
"_draft": { | |
"nbviewer_url": "https://gist.github.com/2e025ecff56620fdcc1966b788f85b72" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment