简体   繁体   English

是否有适用于 ubuntu 18.04 的 torchvision 0.13.0 版本?

[英]Is there a torchvision 0.13.0 version available for ubuntu 18.04?

I have used prior versions of torchvision in my docker images in the past however now I am trying to install torchvision version 0.13.0 onto the image (OS = ubuntu 18.04) however anytime my requirements.txt file hits the line我过去曾在我的 docker 图像中使用过以前版本的 torchvision 但是现在我正在尝试将torchvision 0.13.0 版安装到图像上(OS = ubuntu 18.04)但是任何时候我的 requirements.txt 文件都会遇到问题

torchvision==0.13.0

I get this error我收到这个错误

Could not find a version that satisfies the requirement torchvision==0.13.0找不到满足要求的版本 torchvision==0.13.0

I installed and used the same version on google colabs so I know the it is available, I just need a way to get it onto ubuntu via docker.我在 google colabs 上安装并使用了相同的版本,所以我知道它是可用的,我只需要一种方法通过 docker 将它放到 ubuntu 上。 I also tried installing the same version directly on a ubuntu 18.04 VM (same error) so I think it is an issue with ubuntu.我还尝试直接在 ubuntu 18.04 VM 上安装相同的版本(相同的错误),所以我认为这是 ubuntu 的问题。

I have tried我努力了

  • adding line pip install torchvision==0.13.0 to requirements.txt添加行 pip install torchvision==0.13.0 到 requirements.txt

Solved by installing torchvision via "RUN" command in dockerfile.通过在 dockerfile 中通过“RUN”命令安装 torchvision 解决。

Adding the following lines in the dockerfile fixed the issue:在 dockerfile 中添加以下行修复了该问题:

RUN apt-get update && apt-get install -y build-essential && apt-get install -y wget && apt-get clean 

# Install miniconda
ENV CONDA_DIR /opt/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && /bin/bash ~/miniconda.sh -b -p /opt/conda

# Put conda in path so we can use conda activate
ENV PATH=$CONDA_DIR/bin:$PATH

# Install torchvision
RUN conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM