Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Previous network clone epoch #1610

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't these lines do the trick?

DIGITS/.travis.yml

Lines 86 to 89 in 776131d

- libboost-filesystem-dev
- libboost-python-dev
- libboost-system-dev
- libboost-thread-dev

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This build was fine, without the updated boost: https://travis-ci.org/NVIDIA/DIGITS/builds/217367405

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change that broke things: BVLC/caffe#5526


install:
- mkdir -p ~/.config/matplotlib
Expand Down
6 changes: 6 additions & 0 deletions digits/model/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
4 changes: 3 additions & 1 deletion digits/model/images/classification/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a "terrible hack" necessary?

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()
Expand Down
3 changes: 3 additions & 0 deletions digits/model/images/generic/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{% if snapshot_list|length %}
<select class="form-control" id="{{network.data}}-snapshot" name="{{network.data}}-snapshot">
{% for each_epoch in snapshot_list %}
<option value="{{each_epoch[0]}}">{{each_epoch[1]}}</option>
<option value="{{each_epoch[0]}}" {{'selected' if each_epoch[0] == form.saved_epoch.data}}>{{each_epoch[1]}}</option>
{% endfor %}
</select>
{% endif %}
Expand All @@ -39,7 +39,6 @@
</tr>
{% endfor %}
</table>

</div>
{% endfor %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{% if snapshot_list|length %}
<select class="form-control" id="{{network.data}}-snapshot" name="{{network.data}}-snapshot">
{% for each_epoch in snapshot_list %}
<option value="{{each_epoch[0]}}">{{each_epoch[1]}}</option>
<option value="{{each_epoch[0]}}" {{'selected' if each_epoch[0] == form.saved_epoch.data}}>{{each_epoch[1]}}</option>
{% endfor %}
</select>
{% endif %}
Expand Down