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

相关推荐
serve the people1 天前
TensorFlow 2.0 手写数字分类教程之SparseCategoricalCrossentropy 核心原理(一)
人工智能·分类·tensorflow
serve the people1 天前
tensorflow tf.nn.softmax 核心解析
人工智能·python·tensorflow
serve the people1 天前
TensorFlow 2.0 手写数字分类教程之SparseCategoricalCrossentropy 核心原理(二)
人工智能·分类·tensorflow
serve the people1 天前
TensorFlow 2.0 手写数字分类教程之SparseCategoricalCrossentropy 核心原理(三)
人工智能·分类·tensorflow
serve the people1 天前
TensorFlow 2.0 手写数字分类教程之SparseCategoricalCrossentropy 核心原理(四)
人工智能·分类·tensorflow
free-elcmacom1 天前
深度学习<1>PyTorch与TensorFlow新特性深度解析
人工智能·pytorch·python·深度学习·tensorflow
柒.梧.2 天前
CSS 基础样式与盒模型详解:从入门到实战进阶
人工智能·python·tensorflow
2503_928411564 天前
项目中的一些问题(补充)
人工智能·python·tensorflow
MarkHD4 天前
智能体在车联网中的应用:第7天 核心工具链与仿真世界:Python与AI开发环境全栈配置指南——从Anaconda到Jupyter
人工智能·python·jupyter
阿华田5124 天前
如何基于Jupyter内核自研NoteBook
ide·python·jupyter·自研notebook