如果你遇到了这种问题,可以尝试以下方法:
import tensorflow as tf
print(tf.version.VERSION) print(tf.compat.v1.protobuf.internal_api_version)
pip install tensorflow --upgrade pip install protobuf --upgrade
conda install tensorflow conda install protobuf
pip uninstall protobuf pip install protobuf
pip uninstall tensorflow pip install tensorflow
希望这些方法能帮助你解决 protobuf 不兼容的问题。