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

相关推荐
七号练习生.c1 小时前
CSS入门
前端·css·tensorflow
x_lrong18 小时前
Linux虚拟机配置jupyter环境并在宿主机访问
linux·运维·笔记·jupyter·虚拟机
24kHT18 小时前
conda以及Jupyter notebook的使用
windows·jupyter·conda
一个数据大开发2 天前
【零基础一站式指南】Conda 学习环境准备与 Jupyter/PyCharm 完全配置
学习·jupyter·conda
盼小辉丶2 天前
语义分割详解与实现
深度学习·计算机视觉·keras
如何原谅奋力过但无声3 天前
TensorFlow 2.x常用函数总结(持续更新)
人工智能·python·tensorflow
nvd113 天前
asyncio.run() vs asyncio.gather():启动器与聚合器, 为何Jupyter notebook里能直接使用await?
开发语言·python·jupyter
EEG小佬3 天前
Jupyter选择内核时如何找到虚拟环境
ide·python·jupyter
却道天凉_好个秋4 天前
目标检测算法与原理(二):Tensorflow实现迁移学习
算法·目标检测·tensorflow
苏打水com4 天前
0基础学前端:100天拿offer实战课(第3天)—— CSS基础美化:给网页“精装修”的5大核心技巧
人工智能·python·tensorflow