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

相关推荐
serve the people19 小时前
TensorFlow tf.GradientTape(梯度带)的高级用法指南
人工智能·python·tensorflow
红队it19 小时前
【Tensorflow】基于卷积神经网络(CNN)交通标志图像识别系统(完整系统源码+数据库+开发笔记+详细部署教程+启动教程)✅
python·深度学习·pycharm·cnn·毕业设计·tensorflow·echarts
serve the people20 小时前
tensorflow不规则张量(RaggedTensor)的存储约束
人工智能·tensorflow·neo4j
serve the people21 小时前
TensorFlow 中不规则张量(RaggedTensor)
人工智能·tensorflow·neo4j
水木姚姚21 小时前
TensorFlow在Microsoft Windows 11下编程
人工智能·windows·python·深度学习·tensorflow·ai编程
serve the people1 天前
TensorFlow 不规则张量(RaggedTensor)的两种核心构造方式
人工智能·tensorflow·neo4j
serve the people1 天前
TensorFlow 高级自动微分
人工智能·tensorflow·neo4j
黑客思维者2 天前
Python 机器学习TensorFlow 2.x 入门实战:CNN/RNN/Transformer
python·机器学习·tensorflow
sherlock_ye42 天前
‘jupyter‘ 不是内部或外部命令,也不是可运行的程序或批处理文件,最终解决方案!
ide·python·jupyter·conda
JoannaJuanCV2 天前
深度学习框架keras使用—(1)CNN经典模型:VGGNet
深度学习·cnn·keras