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

相关推荐
sphw4 天前
nixnb: Jupyter Notebook 优雅分享
ide·人工智能·jupyter
编程阿峰5 天前
Python 环境配置(二)安装jupyter、matplotlib、numpy库
开发语言·python·jupyter·numpy·matplotlib
魔尔助理顾问6 天前
安装 Jupyter Notebook (推荐给 venv 用户)
开发语言·ide·python·jupyter
xuhe28 天前
一劳永逸!解决 AutoDL 系统盘(30GB)爆满与 pip 缓存迁移
linux·python·ai·jupyter
kisloy8 天前
【爬虫入门第2讲】浏览器开发者工具完全指南
人工智能·爬虫·tensorflow
中微极客8 天前
边缘AI实战:TinyML模型量化与部署全解析(TensorFlow 2.18.0 + ESP32)
人工智能·python·tensorflow
人工干智能8 天前
Keras深度学习训练范式:构建模型 (Build)→ 配置训练规则 (Compile)→ 执行训练(Fit) + 回调控制(Callback)
人工智能·深度学习·keras
JR空位投 李佃贵是8 天前
如何编写轻量级 CSS 框架
前端·css·tensorflow
Y3815326629 天前
serpbase + Pandas + Jupyter 数据分析实战
jupyter·数据分析·pandas
栈溢出了14 天前
Jupyter 添加虚拟环境 Kernel 笔记
ide·笔记·jupyter