1.安装前先查看两者对应的版本(很重要,否则会遇到一些错误)
2、安装命令
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --user tensorflow==2.1.0
pip install -i https://pypi.douban.com/simple/ keras==2.3.1
3.查看安装后的版本
>>> import tensorflow as tf
>>> print(tf.__version__)
>>> import keras as ks
>>> print(ks.__version__)
4.报错解决
import keras 或tensenflow后使用报错
错误一:ImportError: cannot import name 'get_config'
原因:版本没对应,卸载重装
错误二:Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
解决方法: https://blog.csdn.net/weixin_43786241/article/details/109203995?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-109203995-blog-105267552.pc_relevant_aa&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-109203995-blog-105267552.pc_relevant_aa&utm_relevant_index=1 ?
下载文件,解压,将cudart64_101.dll复制到C:\WINDOWS\system32路径下,然后电脑重启
|