Skip to content

Download torchvision models #232

@wdhorton

Description

@wdhorton

Right now in order to use pre-trained torchvision models (as well as libraries using torchvision, like fastai), you need to import the weights as another dataset (like https://www.kaggle.com/pytorch/resnet34) and then write some code to copy it into the right place in the filepath. The code looks like this (from this kernel):

cache_dir = os.path.expanduser(os.path.join('~', '.torch'))
if not os.path.exists(cache_dir):
    os.makedirs(cache_dir)
models_dir = os.path.join(cache_dir, 'models')
if not os.path.exists(models_dir):
    os.makedirs(models_dir)
!cp ../input/resnet34/resnet34.pth /tmp/.torch/models/resnet34-333f7ec4.pth

I think that we can help people avoid having to work around it in this way--since the Dockerfile already has downloads for other tools (like spacy and nltk), I think it would be helpful to also download some pretrained image models so people can get started in a more straightforward manner. And since the image is already pretty large (~16.8GB), it shouldn't make a significant impact on the size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions