Tensorflow和Keras安装流程,jupyter无法使用keras解决方案

Tensorflow和Keras安装流程,jupyter无法使用keras解决方案

1.Base: anaconda https://www.anaconda.com/download

2.安装python=3.8,Tensorflow=2.13.0,Keras=2.13.1

--创建conda环境-在Anaconda Prompt中输入命令, conda create -n tensorflow python=3.8

--激活环境 activate tensorflow

--安装Tensorflow pip install tensorflow==2.13.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

--安装Keras pip install keras==2.13.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

--在tensorflow环境中,进入python,输入import tensorflow 和 import keras测试

3.打开jupyter notebook,运行import keras会报错:'No module name tensorflow' ,jupyter notebook内核没有切换环境。

在Anaconda Prompt中操作:

--安装ipython conda install ipython

--安装jupyter conda install jupyter

--查看可用kernel:jupyter kernelspec list

--在tensorflow虚拟环境下,安装ipykernel: conda install ipykernel

python -m ipykernel install --name tensorflow

运行jupyter notebook:jupyter notebook

Success!

tensorflow、python版本对应关系 https://tensorflow.google.cn/install/source?hl=en#cpu

相关推荐
木觞清3 小时前
PyTorch与TensorFlow的对比:哪个框架更适合你的项目?
人工智能·pytorch·tensorflow
盼小辉丶8 小时前
TensorFlow深度学习实战(8)——卷积神经网络
深度学习·cnn·tensorflow
溯源0062 天前
在conda虚拟环境中安装jupyter lab-----deepseek问答记录
ide·jupyter·conda
紫雾凌寒5 天前
深度学习框架探秘|Keras 应用案例解析以及 Keras vs TensorFlow vs PyTorch
人工智能·pytorch·python·深度学习·ai·tensorflow·keras
tRNA做科研5 天前
2025最新深度学习pytorch完整配置:conda/jupyter/vscode
pytorch·深度学习·jupyter
羊小猪~~5 天前
深度学习项目--基于RNN的阿尔茨海默病诊断研究(pytorch实现)
人工智能·pytorch·rnn·深度学习·神经网络·机器学习·tensorflow
奔跑吧邓邓子5 天前
【Python深入浅出㊸】解锁Python3中的TensorFlow:开启深度学习之旅
python·深度学习·tensorflow
忆~遂愿6 天前
时尚搭配助手,深度解析用Keras构建智能穿搭推荐系统
人工智能·python·深度学习·机器学习·keras
紫雾凌寒6 天前
深度学习框架探秘|TensorFlow vs PyTorch:AI 框架的巅峰对决
人工智能·pytorch·深度学习·ai·tensorflow
apple-mapping7 天前
tensorflow环境中已安装库
人工智能·python·tensorflow