facebookresearch/d2go

ImportError: cannot import name 'metanet_pb2' from 'caffe2.proto' (/usr/local/lib/python3.7/dist-packages/caffe2/proto/__init__.py)

nikitha-debug opened this issue · 1 comments

<import copy
from detectron2.data import build_detection_test_loader
from d2go.export.api import convert_and_export_predictor

from d2go.export.d2_meta_arch import patch_d2_meta_arch

/usr/local/lib/python3.7/dist-packages/caffe2/proto/__init__.py:17: UserWarning: Caffe2 support is not enabled in this PyTorch build. Please enable Caffe2 by building PyTorch from source with BUILD_CAFFE2=1` flag.
warnings.warn('Caffe2 support is not enabled in this PyTorch build. '


ImportError Traceback (most recent call last)

in ()
3 from d2go.export.api import convert_and_export_predictor
4
----> 5 from d2go.export.d2_meta_arch import patch_d2_meta_arch

3 frames

/usr/local/lib/python3.7/dist-packages/caffe2/proto/init.py in ()
13 # This has to be done for all python targets, so listing them here
14 try:
---> 15 from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
16 except ImportError:
17 warnings.warn('Caffe2 support is not enabled in this PyTorch build. '

ImportError: cannot import name 'metanet_pb2' from 'caffe2.proto' (/usr/local/lib/python3.7/dist-packages/caffe2/proto/init.py)

Now there should be no caffe2 code at import time, close the issue.