在使用import tensorflow_datasets as tfds 时报错 ImportError: cannot import name 'runtime_version' from 'google.protobuf' 

后检查发现是protobuf版本与tensorflow版本不一致,进而导致兼容性问题。

版本兼容示例

tensorflow == 2.15.0

tensorflow-datasets==4.9.9

protobuf == 4.25.8

版本不兼容示例

tensorflow == 2.20.0

tensorflow-datasets==4.9.9

protobuf == 4.25.8

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐