Closed roymx closed 5 years ago
Hi @roymx - thanks for reporting this
I have updated the Dockerfile to use torchvision 0.2.2 . This resolves the error.
If you would like to use the latest torch version
You can replace the models with the directory models_1p0
mv models_1p0 models
and then install the latest pytorch version build with CUDA 8.0
pip install torch==1.1 -f https://download.pytorch.org/whl/cu80/stable torchvision==0.3.0
I will soon update the docker image on our Docker Hub page
Hello @a4anna,
NP I was about to test the same fix on my side 😊 Thanks for the prompt response & tips
I tested this DockerHub image again today and confirm that it is now functional.
Using latest DockerHub image of cmusatyalab/openrtist Commit Source 897a0db created May 31st
Running the openrtist/server causes this error: root@95bc666fa48d:/# cd /openrtist/server root@95bc666fa48d:/openrtist/server# ./proxy.py -s 172.17.0.2:8021 Autodetect: failed to load OpenVINO; fallback to pyTorch Traceback (most recent call last): File "./proxy.py", line 65, in
from torchvision import datasets
File "/usr/local/lib/python2.7/dist-packages/torchvision/init.py", line 1, in
from torchvision import models
File "/usr/local/lib/python2.7/dist-packages/torchvision/models/init.py", line 10, in
from . import segmentation
File "/usr/local/lib/python2.7/dist-packages/torchvision/models/segmentation/init.py", line 1, in
from .segmentation import *
File "/usr/local/lib/python2.7/dist-packages/torchvision/models/segmentation/segmentation.py", line 1, in
from .._utils import IntermediateLayerGetter
File "/usr/local/lib/python2.7/dist-packages/torchvision/models/_utils.py", line 7, in
class IntermediateLayerGetter(nn.ModuleDict):
AttributeError: 'module' object has no attribute 'ModuleDict'
root@95bc666fa48d:/openrtist/server#
In the container, the bundled version of
/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py
does not contain functionModuleDict
which is expected by torchvision.Dockerfile (on DockerHub) shows that
On Torch side, version 0.4.1 is the first version containing
ModuleDict
https://github.com/pytorch/pytorch/blob/v0.4.1/torch/nn/modules/container.pyOn Torchvision side, version 0.3.0 (latest) is the first version where
class IntermediateLayerGetter(nn.ModuleDict)
was introduced. https://github.com/pytorch/vision/blob/v0.3.0/torchvision/models/_utils.pyIn conclusion, versions of Torch and Torchvision bundled in the latest DockerHub container seem out of sync/incompatible.
I'll try to provide a PR if I can get it to build locally.