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

相关推荐
Zeluar7 天前
关闭VSCode Markdown插件在Jupyter Notebook中的自动预览
ide·vscode·jupyter
海绵不是宝宝8177 天前
连接远程服务器上的 jupyter notebook,解放本地电脑
服务器·jupyter·github
细节处有神明9 天前
Jupyter 中实现交互式图表:ipywidgets 从入门到部署
ide·python·jupyter
六月闻君13 天前
Jupyter 使用特定的虚拟环境配置
ide·python·jupyter
SugarPPig13 天前
TensorFlow 和 Transformer 的关系
人工智能·tensorflow·transformer
weixin_4569042714 天前
基于Tensorflow2.15的图像分类系统
人工智能·分类·tensorflow
麦兜*17 天前
内存杀手机器:TensorFlow Lite + Spring Boot移动端模型服务深度优化方案
java·人工智能·spring boot·spring cloud·ai·tensorflow·ai编程
A5rZ17 天前
css leak -- justctf 2025 Simple Tasks
前端·css·tensorflow
盼小辉丶19 天前
TensorFlow深度学习实战(29)——自监督学习(Self-Supervised Learning)
深度学习·tensorflow·自监督学习
斯~内克20 天前
CSS包含块与百分比取值机制完全指南
前端·css·tensorflow