facebookresearch / pytext

A natural language modeling framework based on PyTorch
https://pytext.readthedocs.io/en/master/
Other
6.34k stars 800 forks source link

ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' #1719

Open bhomass opened 2 years ago

bhomass commented 2 years ago

Steps to reproduce

  1. git clone https://github.com/facebookresearch/Clinical-Trial-Parser.git
  2. install pytext by source https://pytext.readthedocs.io/en/master/installation.html#install-from-source
  3. go build ./...
  4. go test ./...
  5. pytext train < src/resources/config/ner.json

Observed Results

from caffe2.proto import caffe2_pb2 File "/data/anaconda3/envs/pytext/lib/python3.8/site-packages/caffe2/proto/init.py", line 15, in from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2 ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto'

Expected Results

I expect pytext to carry out the trainig

Relevant Code

in https://github.com/facebookresearch/Clinical-Trial-Parser.git


// TODO(you): code here to reproduce the problem
I have been trying to get this lib to work for three days. I have tried python 3.5, 3.6, 3.7, and 3.10.
I have tried installing pytext using conda, pip, and build from source.

googling ends up in dead trails where people continue to see the same problem, but previously raised tickets are closed.

Please give indication how to get past this step?
bhomass commented 2 years ago

I get the same error following the README in this repo by running

pytext export < demo/configs/docnn.json