Versioning of PyTorch and Torchvision
FROM 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-inference:1.5.1-gpu-py36-cu101-ubuntu16.04
I am trying to use the PyTorch-1.5.1 image with detectron2-0.1.3 and am having import errors.
detectron2 has documentation for the errors I'm seeing under this common installation issue: Undefined symbols that contains TH,aten,torch,caffe2; Missing torch dynamic libraries; Segmentation fault immediately when using detectron2. (https://detectron2.readthedocs.io/tutorials/install.html#install-pre-built-detectron2-linux-only)
Which suggests that the error may be with the versioning of PyTorch and Torchvision and recommends re-installing PyTorch from their website.
Detectron2's "collect_env.py" script shows the following with this image: torchvision 0.6.0 @/opt/conda/lib/python3.6/site-packages/torchvision PyTorch 1.5.1 @/opt/conda/lib/python3.6/site-packages/torch detectron2 0.1.3 @/opt/amazon/lib/python3.6/site-packages/detectron2 detectron2._C failed to import
The PyTorch documentation for installing suggests that PyTorch 1.5.1 should be installed with Torchvision-0.6.1 https://pytorch.org/get-started/previous-versions/
I see that the PyTorch-1.5.1 offering here specifically installs Torchvision-0.6.0 https://github.com/aws/deep-learning-containers/blob/master/pytorch/inference/docker/1.5.1/py3/cu101/Dockerfile.gpu#L86
I took my customized container built from this image and uninstalled PyTorch, Torchvision and detectron2 then re-installed all of them via pip with PyTorch-1.5.1, Torchvision-0.6.1 and detectron2-0.1.3 and that resolved all the import issues I was having.
Considering that the PyTorch documentation suggests that Torchvision-0.6.1 be installed with PyTorch-1.5.1 is there a particular reason that this image is specifically using Torchvision-0.6.0? Not sure if it would be possible to request that this image is updated to use Torchvision-0.6.1
@bgleadle thanks for pointing out the discrepancy. We are looking into it.