第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