Conflicted version of "protobuf" in "ray" and "BertForSequenceClassification"

#218
by kamisama0101 - opened

Thank you for your great work in geneformer and patient answer in my last question!

  1. For "from transformers import BertForSequenceClassification":
    "RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback):
    cannot import name 'builder' from 'google.protobuf.internal'"

  2. for "import ray":
    "Downgrade the protobuf package to 3.20.x or lower."

I found a lower version of "protobuf" is required for "ray", but a higher version of "protobuf" is required for "BertForSequenceClassification". How can I combine two of them? Besides, what's the python version you used?

Hi! I suggest creating a conda env: https://conda.io/projects/conda/en/latest/user-guide/install/index.html (Python 3.10.12). You can then install ray through the PyPi channel with !pip install ray and !pip install ray[tune]. This installation will set Ray to 2.6.1/2.6.X. Package dependencies are easily resolved using conda/mamba when setting up Python environments.

  • Madhavan
ctheodoris changed discussion status to closed

Sign up or log in to comment