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

相关推荐
@大迁世界1 天前
32.CSS魔术师 (CSS Houdini)
前端·css·人工智能·tensorflow·houdini
小鸡吃米…14 天前
基于 TensorFlow 的图像识别
人工智能·python·tensorflow
小鸡吃米…14 天前
TensorFlow - 构建计算图
人工智能·python·tensorflow
A懿轩A14 天前
【2026 最新】TensorFlow 安装配置详细指南 同时讲解安装CPU和GPU版本 小白也能轻松上手!逐步带图超详细展示(Windows 版)
人工智能·windows·python·深度学习·tensorflow
开发者小天14 天前
python中使用jupyter notebook 绘制正态分布直方图 密度图 小提琴图 模仿企鹅喙长分布图
开发语言·python·jupyter
小鸡吃米…15 天前
TensorFlow 实现异或(XOR)运算
人工智能·python·tensorflow·neo4j
小鸡吃米…15 天前
TensorFlow 实现梯度下降优化
人工智能·python·tensorflow·neo4j
甄心爱学习15 天前
【LR逻辑回归】原理以及tensorflow实现
算法·tensorflow·逻辑回归
小鸡吃米…16 天前
TensorFlow 实现多层感知机学习
人工智能·python·tensorflow
小鸡吃米…16 天前
TensorFlow 优化器
人工智能·python·tensorflow