# \_model\_URL import error

**URL:** <https://discuss.pytorch.org/t/model-url-import-error/161112>\
**Category:** vision\
**Created:** [September 10, 2022, 3:36pm UTC](https://discuss.pytorch.org/t/model-url-import-error/161112 "2022-09-10T15:36:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArshadIram](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/arshadiram/32/32886_2.png) [@ArshadIram](https://discuss.pytorch.org/u/ArshadIram)\
**Post date:** [September 10, 2022, 3:36pm UTC](https://discuss.pytorch.org/t/model-url-import-error/161112/1 "2022-09-10T15:36:42Z")

</div>

```auto
ImportError: cannot import name '_MODEL_URLS' from 'torchvision.models.mnasnet'

```

I am getting import error while import this:

```auto
from torchvision.models.mnasnet import _MODEL_URLS as URLs 

```

Any help would be highly appreciated.

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [September 11, 2022, 7:11am UTC](https://discuss.pytorch.org/t/model-url-import-error/161112/2 "2022-09-11T07:11:31Z")

</div>

The `_MODEL_URLS` `dict` was removed in [this PR](https://github.com/pytorch/vision/pull/5618). I don’t know what exactly you want to do with these URLs, but look at the PR to see how to use the introduced `weights` object to load the `state_dict`s.

---

<div class="post-metadata">

**Author:** ![ArshadIram](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/arshadiram/32/32886_2.png) [@ArshadIram](https://discuss.pytorch.org/u/ArshadIram)\
**Post date:** [September 13, 2022, 7:05am UTC](https://discuss.pytorch.org/t/model-url-import-error/161112/3 "2022-09-13T07:05:22Z")

</div>

Hi @ptrblck, I updated the torch version, and this issue is resolved. However, I am getting an unusual error while downloading datasets on pycharm IDE.

```auto
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)>

```

my torch version is:

```auto
torch. __version__'1.12.1'

```

---

<div class="post-metadata">

**Author:** ![ArshadIram](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/arshadiram/32/32886_2.png) [@ArshadIram](https://discuss.pytorch.org/u/ArshadIram)\
**Post date:** [September 13, 2022, 7:15am UTC](https://discuss.pytorch.org/t/model-url-import-error/161112/4 "2022-09-13T07:15:18Z")

</div>

This issue is also fixed by importing these commands on download file:

```auto
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

```
