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

相关推荐
bzmK1DTbd9 小时前
Java在人工智能:TensorFlow Java API的使用
java·人工智能·tensorflow
wayz111 天前
深入解析 Adam 优化器
深度学习·神经网络·keras
独隅3 天前
Anaconda 配置 Keras 环境的详细流程指南
人工智能·深度学习·keras
傲笑风4 天前
jupyter转PDF教程
python·jupyter
wayz114 天前
Day 18 编程实战:Keras搭建MLP神经网络
人工智能·神经网络·keras
一晌小贪欢4 天前
第1节:数据分析环境配置——Jupyter Notebook全攻略
jupyter·数据挖掘·数据分析·可视化·数据可视化
江南十四行5 天前
从零开始掌握BP神经网络:基于TensorFlow的回归与分类实战
神经网络·回归·tensorflow
绘梨衣5475 天前
Agentic RAG、传统RAG、ReAct、Function Calling 核心关系
人工智能·chatgpt·tensorflow
袋子(PJ)7 天前
2026年pytorch基础学习(基于jupyter notebook开发)——从原理到落地:PyTorch神经网络架构与工程优化解析
人工智能·pytorch·深度学习·学习·jupyter
wayz117 天前
Day 18:Keras深度学习框架入门
人工智能·深度学习·神经网络·算法·机器学习·keras