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

相关推荐
星马梦缘1 天前
强化学习实战5——BaseLine3使用自定义环境训练【输入状态向量】
pytorch·python·jupyter·强化学习·baseline3·gymnasium
我姓徐1 天前
TensorFlow 模型训练和简单部署示例
python·tensorflow
独隅2 天前
Keras 的主要特点和适用场景
人工智能·深度学习·keras
独隅2 天前
在 Linux 上部署 Keras 模型的全面指南
linux·运维·keras
溟有常青木3 天前
Jupyter notebook学习容易忘的点
学习·jupyter
星马梦缘3 天前
cannot import name ‘deserialize‘ from ‘tensorflow.keras.models‘ 的解决方案
tensorflow·keras·neo4j
星马梦缘3 天前
cannot import name ‘__version__‘ from ‘tensorflow.keras‘ 的解决方案
人工智能·tensorflow·keras
独隅3 天前
在 MacOS 上部署 Keras 模型的全面指南
人工智能·macos·keras
独隅4 天前
在 Linux 上部署 TensorFlow 模型的全面指南
linux·运维·tensorflow
独隅4 天前
Keras 全面介绍:从入门到实践
人工智能·深度学习·keras