0

I need to update a package to beyond the version that appears on the pip (pip3) repository.

The package is torchvision; https://pytorch.org/

The version that pip3 has is 0.2.1 and I need at least 0.4.0. Conda is even more out of date. I would just download and compile from source, but after that I don't think I can use pip to uninstall or update it. Would pip even know it was installed? Or would it try to reinstall it next time if it found something that listed it as a dependency?

What is the least messy way to update torchvision?

I'm on Ubuntu 16.04.

Edit; In response to comments pip3 doesn’t seem to offer what I need directly; pip3 offerings

9
  • This isn't an answer but it should be. pytorch is going to make a mess until you get rid of conda and Anaconda, and start over with Python packages from the default Ubuntu repositories. Then update pip with sudo -H pip3 install --upgrade pip and/or sudo -H pip2 install --upgrade pip This is the least messy way to update torchvision.
    – karel
    May 5, 2018 at 11:53
  • 1
    @karel I actually don't have conda at the moment (although if it solved things I would be willing to get it). My pip3 is up to date, but the version of torchvision it offers is still 0.2.1
    – Clumsy cat
    May 5, 2018 at 12:00
  • According to your screenshot everything is working correctly, and pip is showing the latest version of torchvision version 0.2.1 which has the Home-page: github.com/pytorch/vision
    – karel
    May 5, 2018 at 12:07
  • @karel I maybe being really slow here, but is that not 0.4.0? The function I'm trying to get at is pytorch.org/docs/stable/…
    – Clumsy cat
    May 5, 2018 at 12:16
  • The latest version of pytorch at: github.com/pytorch/pytorch/releases is version 0.4.0. The latest version of torchvision at: github.com/pytorch/vision is version 0.2.1. It seems like pip is good, everything is good and your question is Can I install torchvision 0.2.1 with pytorch 0.4.0 and will it run OK? I don't know. I haven't tried it. Someone else will have to answer that question.
    – karel
    May 5, 2018 at 12:17

1 Answer 1

1

I haven’t tried these exact steps, but I think it should work. First uninstall any current versions of torch and torch-vision (or even better, use a Python virtual environment or a new Conda environment).

Next install the latest version of torch from GitHub using:

pip install https://github.com/pytorch/torch/archive/master.zip

Then install the latest version of torch-vision from GitHub if you need it using:

pip install https://github.com/pytorch/vision/archive/master.zip

I looked at the requirements field in setup.py and I don’t think there should be any dependency issues.

You will not be able to use pip to upgrade it in the future, but you can easily uninstall it with pip uninstall and then install the latest version using the same steps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.