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

相关推荐
山海青风25 分钟前
从零开始玩转TensorFlow:小明的机器学习故事 3
人工智能·机器学习·tensorflow
孤寂大仙v2 小时前
深度学习实战:使用TensorFlow构建卷积神经网络(CNN)
深度学习·cnn·tensorflow
Y_3_712 小时前
30 分钟从零开始入门 CSS
开发语言·前端·css·人工智能·python·tensorflow
zhulu50614 小时前
PyTorch 源码学习:GPU 内存管理之它山之石——TensorFlow BFC 算法
学习·tensorflow
你若盛开,清风自来!1 天前
在VSCode中安装jupyter跑.ipynb格式文件
vscode·jupyter·pyathon
李昊哲小课2 天前
Jupyter Notebook中使用GPU进行计算
人工智能·python·jupyter
山海青风2 天前
从零开始玩转TensorFlow:小明的机器学习故事 6
人工智能·机器学习·tensorflow
drebander2 天前
Anaconda 与 Jupyter Notebook 的结合使用
ide·python·jupyter
山海青风2 天前
从零开始玩转TensorFlow:小明的机器学习故事 5
人工智能·机器学习·tensorflow
OpenSeek3 天前
TensorFlow v2.16 Overview
人工智能·python·tensorflow