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

相关推荐
阿赛工作室2 天前
基于Vue3和TensorFlow.js的数字图像识别应用HTML单文件
javascript·html·tensorflow
winfred_hua2 天前
PyCharm中使用jupyter
ide·jupyter·pycharm
bzmK1DTbd3 天前
Java在人工智能:TensorFlow Java API的使用
java·人工智能·tensorflow
wayz114 天前
深入解析 Adam 优化器
深度学习·神经网络·keras
独隅6 天前
Anaconda 配置 Keras 环境的详细流程指南
人工智能·深度学习·keras
傲笑风7 天前
jupyter转PDF教程
python·jupyter
wayz117 天前
Day 18 编程实战:Keras搭建MLP神经网络
人工智能·神经网络·keras
一晌小贪欢7 天前
第1节:数据分析环境配置——Jupyter Notebook全攻略
jupyter·数据挖掘·数据分析·可视化·数据可视化
江南十四行8 天前
从零开始掌握BP神经网络:基于TensorFlow的回归与分类实战
神经网络·回归·tensorflow
绘梨衣5478 天前
Agentic RAG、传统RAG、ReAct、Function Calling 核心关系
人工智能·chatgpt·tensorflow