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

相关推荐
kyrie_sakura1 天前
python学习笔记15 -- Anaconda,Jupyter,numpy
python·学习·jupyter·numpy
一木 之林1 天前
Miniconda 安装与 Jupyter 使用入门
ide·python·jupyter
Thomas.Sir3 天前
第48课:TensorFlow|TF模型线上部署入门【本地服务封装、接口快速开发】
人工智能·python·tensorflow
lbb 小魔仙3 天前
Jupyter Notebook / Lab 深度配置指南:插件 + 内核 + 远程访问 + 容器化部署
ide·python·jupyter
Thomas.Sir3 天前
第49课:TensorFlow|项目性能调优全方案【训练提速、推理提速、资源占用优化】
人工智能·python·tensorflow
Thomas.Sir4 天前
第45课:TensorFlow|异常检测实战【工业设备数据故障识别模型搭建】
人工智能·python·tensorflow
Thomas.Sir4 天前
第42课:TensorFlow|计算机视觉实战二【图像分割基础流程与数据标注规范】
人工智能·计算机视觉·tensorflow
2601_962301014 天前
深入探索 TensorFlow 2.0:Python 中的强大深度学习框架
深度学习·分布式训练·keras·tensorflow2.0·eagerexecution
典典分享指南5 天前
DeepSeek Harness 开源贡献手记:从 Issue 到 Merge 的完整旅程
jupyter·github·vim·idea·visual studio
Thomas.Sir5 天前
第40课:TensorFlow|模型推理部署前置知识【离线推理、接口调用基础】
人工智能·python·tensorflow