d2go: Demo script fails with ImportError: cannot import name 'metanet_pb2' from 'caffe2.proto'
Instructions To Reproduce the š Bug:
What exact command you run: python demo.py --config-file faster_rcnn_fbnetv3a_C4.yaml --input input1.jpg --output output1.jpg
Full logs or other relevant observations:
(d2go) mat@ada:~/repos/d2go/demo$ python demo.py --config-file faster_rcnn_fbnetv3a_C4.yaml --input input1.jpg --output output1.jpg
Traceback (most recent call last):
File "demo.py", line 11, in <module>
from d2go.model_zoo import model_zoo
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/d2go/model_zoo/model_zoo.py", line 7, in <module>
from d2go.runner import create_runner
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/d2go/runner/__init__.py", line 10, in <module>
from .default_runner import BaseRunner, Detectron2GoRunner, GeneralizedRCNNRunner
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/d2go/runner/default_runner.py", line 28, in <module>
from d2go.export.d2_meta_arch import patch_d2_meta_arch
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/d2go/export/__init__.py", line 5, in <module>
from . import torchscript # noqa
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/d2go/export/torchscript.py", line 13, in <module>
from detectron2.export.flatten import TracingAdapter, flatten_to_tuple
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/detectron2/export/__init__.py", line 3, in <module>
from .api import *
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/detectron2/export/api.py", line 6, in <module>
from caffe2.proto import caffe2_pb2
File "/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/caffe2/proto/__init__.py", line 11, in <module>
from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
ImportError: cannot import name 'metanet_pb2' from 'caffe2.proto' (/home/mat/anaconda3/envs/d2go/lib/python3.7/site-packages/caffe2/proto/__init__.py)
pytorch 1.11.0.dev20211109 py3.7_cuda10.2_cudnn7.6.5_0 pytorch-nightly
pytorch-lightning 1.5.0 pypi_0 pypi
Was unable to track down what the issue was. Tried installing stable PyTorch build and got segfault
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
Commits related to this issue
- avoid caffe2 imports in d2go/modeling/meta_arch/rcnn.py Summary: fix https://github.com/facebookresearch/d2go/issues/137 Differential Revision: D32690938 fbshipit-source-id: 02dfb13024965ac1ec7e670... — committed to ppwwyyxx/d2go by ppwwyyxx 3 years ago
- avoid caffe2 imports in d2go/modeling/meta_arch/rcnn.py Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/146 fix https://github.com/facebookresearch/d2go/issues/137 Dif... — committed to ppwwyyxx/d2go by ppwwyyxx 3 years ago
- avoid caffe2 imports in d2go/modeling/meta_arch/rcnn.py Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/146 fix https://github.com/facebookresearch/d2go/issues/137 Dif... — committed to ppwwyyxx/d2go by ppwwyyxx 3 years ago
- avoid caffe2 imports in d2go/modeling/meta_arch/rcnn.py Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/146 OSSpytorch package removed caffe2. This causes https://githu... — committed to facebookresearch/d2go by ppwwyyxx 3 years ago
Also facing this issue. Please help
I believe that the same possible with conda, but it was pip installation
pip3 install --pre torch==1.11.0.dev20211001+cu113 torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu113/torch_nightly.htmlInstallation of these particular versions where the solution for me
Iām running into the same error (when running ./test/dlrm_s_test.sh)
Hi @nightheronry,
Iām currently facing the same issue you had. Were you able to resolve this?
Thanks.