第0步:卸载protobuf
pip uninstall protobuf
第1步:卸载tensorflow
pip uninstall tensorflow
pip uninstall tensorflow-gpu
第2步:强制重新安装Tensorflow并支持GPU
pip install --upgrade --force-reinstall tensorflow-gpu
第3步:如果还没有,请设置CUDA_VISIBLE_DEVICES
所以对我来说有2个GPU就可以了
export CUDA_VISIBLE_DEVICES=0,1