From 513f2880cfad0683b8c88ecc4338cc91652f163c Mon Sep 17 00:00:00 2001 From: Joe Mancewicz Date: Fri, 28 Apr 2017 13:33:05 -0700 Subject: [PATCH 1/4] save the previous network epoch for clone --- digits/model/forms.py | 6 ++++++ digits/model/images/classification/views.py | 4 +++- digits/model/images/generic/views.py | 3 +++ .../classification/partials/new/network_tab_previous.html | 3 +-- .../images/generic/partials/new/network_tab_previous.html | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/digits/model/forms.py b/digits/model/forms.py index 797e2e9a3..735a379b1 100644 --- a/digits/model/forms.py +++ b/digits/model/forms.py @@ -284,6 +284,12 @@ def validate_lr_multistep_values(form, field): ], ) + # This is used to save and restore for cloning because the pretrained model selections are + # created on the fly in the html file. This form is not displayed. + saved_epoch = utils.forms.TextField( + 'Saved epoch', + ) + custom_network = utils.forms.TextAreaField( 'Custom Network', validators=[ diff --git a/digits/model/images/classification/views.py b/digits/model/images/classification/views.py index 9d5d12012..86054507e 100644 --- a/digits/model/images/classification/views.py +++ b/digits/model/images/classification/views.py @@ -204,8 +204,10 @@ def create(): "Pretrained_model for the selected epoch doesn't exist. " "May be deleted by another user/process. " "Please restart the server to load the correct pretrained_model details.") - break + # terrible hack to save the epoch for cloning + form.saved_epoch.data = epoch + break elif form.method.data == 'pretrained': pretrained_job = scheduler.get_job(form.pretrained_networks.data) model_def_path = pretrained_job.get_model_def_path() diff --git a/digits/model/images/generic/views.py b/digits/model/images/generic/views.py index 01a9270d7..e0e0d20f9 100644 --- a/digits/model/images/generic/views.py +++ b/digits/model/images/generic/views.py @@ -167,6 +167,9 @@ def create(extension_id=None): "Pretrained_model for the selected epoch doesn't exist. " "May be deleted by another user/process. " "Please restart the server to load the correct pretrained_model details.") + + # terrible hack to save the epoch for cloning + form.saved_epoch.data = epoch break elif form.method.data == 'pretrained': pretrained_job = scheduler.get_job(form.pretrained_networks.data) diff --git a/digits/templates/models/images/classification/partials/new/network_tab_previous.html b/digits/templates/models/images/classification/partials/new/network_tab_previous.html index aeda15146..43782da6e 100644 --- a/digits/templates/models/images/classification/partials/new/network_tab_previous.html +++ b/digits/templates/models/images/classification/partials/new/network_tab_previous.html @@ -26,7 +26,7 @@ {% if snapshot_list|length %} {% endif %} @@ -39,7 +39,6 @@ {% endfor %} - {% endfor %} diff --git a/digits/templates/models/images/generic/partials/new/network_tab_previous.html b/digits/templates/models/images/generic/partials/new/network_tab_previous.html index fa3d2fd82..12577dfe7 100644 --- a/digits/templates/models/images/generic/partials/new/network_tab_previous.html +++ b/digits/templates/models/images/generic/partials/new/network_tab_previous.html @@ -25,7 +25,7 @@ {% if snapshot_list|length %} {% endif %} From 6cd6f24884781ca3952d7a17d93aa91b343e5817 Mon Sep 17 00:00:00 2001 From: Joe Mancewicz Date: Fri, 28 Apr 2017 13:33:21 -0700 Subject: [PATCH 2/4] update boost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5a10e8c19..7ca7500d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,6 +121,7 @@ before_install: - deactivate - virtualenv --system-site-packages ~/venv - source ~/venv/bin/activate + - sudo apt-get install libboost-filesystem1.55-dev libboost-python1.55-dev libboost-system1.55-dev libboost-thread1.55-dev install: - mkdir -p ~/.config/matplotlib From f1faf5529b757a6694757960da670beda3288862 Mon Sep 17 00:00:00 2001 From: Joe Mancewicz Date: Mon, 1 May 2017 10:50:18 -0700 Subject: [PATCH 3/4] update boost without apt-get install --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7ca7500d7..5a10e8c19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,7 +121,6 @@ before_install: - deactivate - virtualenv --system-site-packages ~/venv - source ~/venv/bin/activate - - sudo apt-get install libboost-filesystem1.55-dev libboost-python1.55-dev libboost-system1.55-dev libboost-thread1.55-dev install: - mkdir -p ~/.config/matplotlib From 80c69993d8f693cc6c06261ad434179a4786712c Mon Sep 17 00:00:00 2001 From: Joe Mancewicz Date: Mon, 1 May 2017 11:28:54 -0700 Subject: [PATCH 4/4] update boost --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5a10e8c19..7ca7500d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,6 +121,7 @@ before_install: - deactivate - virtualenv --system-site-packages ~/venv - source ~/venv/bin/activate + - sudo apt-get install libboost-filesystem1.55-dev libboost-python1.55-dev libboost-system1.55-dev libboost-thread1.55-dev install: - mkdir -p ~/.config/matplotlib