错误产生是因为tensorflow已经有更新,旧的内容已经不适用。
更新tensorflow的版本
1、pip uninstall tensorflow
pip uninstall tensorflow
2、pip uninstall tensorflow-gpu
pip uninstall tensorflow-gpu
3、pip install tensorflow
pip install tensorflow
4、pip install tensorflow-gpu
pip install tensorflow-gpu