Skip to content

Added progress flag to model getters #875

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

Merged
merged 4 commits into from
Apr 30, 2019
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Apr 26, 2019

This adds support for disabling the display of the download progress as requested in #862. It depends on torch.hub.load_state_dict_from_url, which is not included in the latest stable release. Thus, this PR will not pass the CI until #826 is merged as @fmassa mentioned.

I also did some refactoring along the way:

  1. For models with multiple different architectures (DenseNet, ResNet, SqueezeNet, and VGG) I added a protected function that all model getter functions use.
  2. I changed the version identifier in SqueezeNet from float to str (e.g. 1.0 to '1_0').

Edit: Apparently this passed CI checks. Beats me why though.

@codecov-io
Copy link

codecov-io commented Apr 26, 2019

Codecov Report

Merging #875 into master will increase coverage by 0.73%.
The diff coverage is 78.12%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #875      +/-   ##
=========================================
+ Coverage   55.17%   55.9%   +0.73%     
=========================================
  Files          36      37       +1     
  Lines        3375    3338      -37     
  Branches      553     531      -22     
=========================================
+ Hits         1862    1866       +4     
+ Misses       1375    1357      -18     
+ Partials      138     115      -23
Impacted Files Coverage Δ
torchvision/models/resnet.py 87.17% <100%> (+3.74%) ⬆️
torchvision/models/utils.py 100% <100%> (ø)
torchvision/models/googlenet.py 73.38% <50%> (-0.54%) ⬇️
torchvision/models/alexnet.py 86.36% <50%> (-4.12%) ⬇️
torchvision/models/inception.py 86.28% <50%> (-0.39%) ⬇️
torchvision/models/squeezenet.py 86.53% <62.5%> (+0.26%) ⬆️
torchvision/models/densenet.py 85.22% <78.94%> (+5.22%) ⬆️
torchvision/models/vgg.py 89.55% <80.76%> (+23.89%) ⬆️
torchvision/datasets/__init__.py 100% <0%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c36735...29032aa. Read the comment docs.

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@fmassa fmassa merged commit e619613 into pytorch:master Apr 30, 2019
fmassa pushed a commit that referenced this pull request May 7, 2019
* Minor refactoring of ShuffleNetV2

Added progress flag following #875. Further the following refactoring was also done:

1) added `version` argument in shufflenetv2 method and removed the operations for converting the `width_mult` arg to float and string.
2) removed `num_classes` argument and **kwargs from functions except `ShuffleNetV2`

* removed `version` arg

* Update shufflenetv2.py

* Removed the try except block

* Update shufflenetv2.py

* Changed version from float to str

* Replace `width_mult` with `stages_out_channels`

Removes the need of  `_getStages` function.
fmassa pushed a commit that referenced this pull request Jun 11, 2019
This PR uses a protected method for loading and initializing the segmentation models. Relevant #875
@pmeier pmeier deleted the download_progress branch July 3, 2019 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants