Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

convert_pkl_to_pb.py import error: ModuleNotFoundError: No module named 'caffe2.caffe2' #969

Open
erickim555 opened this issue Dec 4, 2019 · 0 comments

Comments

@erickim555
Copy link

erickim555 commented Dec 4, 2019

A recent Detectron commit added an import statement that throws an Exception on my system when using tools/convert_pkl_to_pb.py:

$ cd Detectron
$ python3.6 tools/convert_pkl_to_pb.py -h
Traceback (most recent call last):
  File "tools/convert_pkl_to_pb.py", line 44, in <module>
    from caffe2.caffe2.fb.predictor import predictor_exporter, predictor_py_utils
ModuleNotFoundError: No module named 'caffe2.caffe2'

Commit: a6a835f#diff-077e2ae71af52724d94c3522525d2e7fR44

Specifically, this is the problematic import:
from caffe2.caffe2.fb.predictor import predictor_exporter, predictor_py_utils

I am using this pytorch github commit: c3c0dcf6e35efdb843587a03522c37a7d1184539
I verified that, even on the latest pytorch commit (756f279d95d14729e52ccbc4a8d4167725dcaac3), there is no python package caffe2.caffe2.fb.predictor.

One simple workaround fix is to replace the problematic import with the following:
from caffe2.python.predictor import predictor_exporter, predictor_py_utils

I'm unsure if caffe2.caffe2.fb.predictor contains special functionality required for the logfiledb stuff.

Expected results

What did you expect to see?

I expected convert_pkl_to_pb.py to not throw an ImportError

Actual results

What did you observe instead?

I saw an ImportError.

Detailed steps to reproduce

Clone + install Detectron (and pytorch/caffe2), using the above git hashes.
Then, run the following commands:

cd Detectron/
python3.6 tools/convert_pkl_to_pb.py -h

System information

This issue is not related to CUDA/GPU.

  • Operating system: Ubuntu 16.04
  • Compiler version: ?
  • CUDA version: ?
  • cuDNN version: ?
  • NVIDIA driver version: ?
  • GPU models (for all devices if they are not all the same): ?
  • PYTHONPATH environment variable: ?
  • python --version output: Python 3.6.3
  • Anything else that seems relevant: ?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant