I am running simple loading of pre-trained model from my jupyter notebook and it takes forever to do it.
Code:
from torchvision import models
model_ft = models.inception_v3(pretrained=use_pretrained)
the model parameters are downloaded before and it worked fine and I have restarted my computer and it is still not working. When I interrupt the kernel, this is the output:

KeyboardInterrupt                         Traceback (most recent call last)
 in 
----> 1 model_ft = models.inception_v3(pretrained=use_pretrained)
~/anaconda/envs/cs231n/lib/python3.7/site-packages/torchvision/models/inception.py in inception_v3(pretrained, progress, **kwargs)
51         else:
52             original_aux_logits = True
—> 53         model = Inception3(**kwargs)
54         state_dict = load_state_dict_from_url(model_urls[‘inception_v3_google’],
55                                               progress=progress)
~/anaconda/envs/cs231n/lib/python3.7/site-packages/torchvision/models/inception.py in init(self, num_classes, aux_logits, transform_input, inception_blocks)
109                 stddev = m.stddev if hasattr(m, ‘stddev’) else 0.1
110                 X = stats.truncnorm(-2, 2, scale=stddev)
–> 111                 values = torch.as_tensor(X.rvs(m.weight.numel()), dtype=m.weight.dtype)
112                 values = values.view(m.weight.size())
113                 with torch.no_grad():
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_distn_infrastructure.py in rvs(self, size, random_state)
461         kwds = self.kwds.copy()
462         kwds.update({‘size’: size, ‘random_state’: random_state})
–> 463         return self.dist.rvs(*self.args, **kwds)
464
465     def sf(self, x):
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_distn_infrastructure.py in rvs(self, *args, **kwds)
978         # by _rvs().
979         self._size = size
–> 980         vals = self._rvs(*args)
981
982         vals = vals * scale + loc
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_distn_infrastructure.py in _rvs(self, *args)
911         ## Use basic inverse cdf algorithm for RV generation as default.
912         U = self._random_state.random_sample(self._size)
–> 913         Y = self._ppf(U, *args)
914         return Y
915
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_continuous_distns.py in _ppf(self, q, a, b)
7161
7162     def _ppf(self, q, a, b):
-> 7163         return _truncnorm_ppf(q, a, b)
7164
7165     def _munp(self, n, a, b):
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_continuous_distns.py in vf_wrapper(*args)
6931         @functools.wraps(f)
6932         def vf_wrapper(*args):
-> 6933             return vf(*args)
6934         return vf_wrapper
6935     return vectorize_decorator
~/anaconda/envs/cs231n/lib/python3.7/site-packages/numpy/lib/function_base.py in call(self, *args, **kwargs)
2089             vargs.extend([kwargs[_n] for _n in names])
2090
-> 2091         return self._vectorize_call(func=func, args=vargs)
2092
2093     def _get_ufunc_and_otypes(self, func, args):
~/anaconda/envs/cs231n/lib/python3.7/site-packages/numpy/lib/function_base.py in _vectorize_call(self, func, args)
2165                       for a in args]
2166
-> 2167             outputs = ufunc(*inputs)
2168
2169             if ufunc.nout == 1:
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_continuous_distns.py in _truncnorm_ppf(q, a, b)
7079     if q >= 1:
7080         return b
-> 7081     delta = _truncnorm_get_delta(a, b)
7082     if delta > 0:
7083         if a > 0:
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_continuous_distns.py in _truncnorm_get_delta(a, b)
6942         delta = _norm_cdf(b) - _norm_cdf(a)
6943     else:
-> 6944         delta = _norm_sf(a) - _norm_sf(b)
6945     delta = max(delta, 0)
6946     return delta
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_continuous_distns.py in _norm_sf(x)
198
199 def _norm_sf(x):
–> 200     return _norm_cdf(-x)
201
202
~/anaconda/envs/cs231n/lib/python3.7/site-packages/scipy/stats/_continuous_distns.py in _norm_cdf(x)
186
187 def _norm_cdf(x):
–> 188     return sc.ndtr(x)
189
190
KeyboardInterrupt:
However loading model from torch hub works just fine:
model_ft = torch.hub.load(‘pytorch/vision’, ‘inception_v3’, pretrained=True)