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

相关推荐
liangshanbo121520 小时前
什么是CSS原子化?它的优劣势是什么?
前端·css·tensorflow·css原子化
Xiu Yan9 天前
Python 数据分析:Pandas DataFrame 零基础入门教程
python·jupyter·pycharm·numpy·pandas
Xiu Yan10 天前
Python 数据分析:Pandas Series 零基础入门教程
python·jupyter·pycharm·numpy·pandas
zhanghaha131410 天前
HTML系列教程:18_HTML / CSS 颜色零基础详解
css·html·tensorflow
troy12812 天前
Python 基础语法(九):Django/Flask/FastAPI 三大 Web 框架详细对比解析
python·jupyter·django·flask·github·fastapi
落魄大学生之流水线上谋生计14 天前
ROS2从0到企业级完整教程
tensorflow
kyrie_sakura15 天前
python学习笔记15 -- Anaconda,Jupyter,numpy
python·学习·jupyter·numpy
一木 之林15 天前
Miniconda 安装与 Jupyter 使用入门
ide·python·jupyter
Thomas.Sir17 天前
第48课:TensorFlow|TF模型线上部署入门【本地服务封装、接口快速开发】
人工智能·python·tensorflow
lbb 小魔仙17 天前
Jupyter Notebook / Lab 深度配置指南:插件 + 内核 + 远程访问 + 容器化部署
ide·python·jupyter