Speedup InceptionV3 and GoogleNet tests on windows (upgrade scipy) #3196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rough improvement: ~96%
The above are rough estimations based on a couple or runs.
The problem is traced to the use of scipy in the weight initialization of the two models:
vision/torchvision/models/inception.py
Lines 122 to 124 in 90645cc
vision/torchvision/models/googlenet.py
Lines 126 to 128 in 90645cc
The slow down is caused by a regression on scipy affecting versions 1.4.x: scipy/scipy#11299. The reason why only Windows runs are affected is because our CI config is pinning the version of scipy to 1.4.1 on Windows but not on Linux. This was introduced at #2328 (first commit of the file) and it's probably by accident that the two files are not aligned.
By unpinning the version and allowing scipy to use newer versions on Windows, the issue is fixed. This is an alternative solution to #3195.