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

相关推荐
冷雨夜中漫步6 小时前
AI入坑之路——(1)搭建本地的Python与Jupyter开发环境
人工智能·python·jupyter
帮帮志7 小时前
Jupyter使用的快捷键大全
ide·python·jupyter
qq_463944867 小时前
Jupyter中输入标题的方法
ide·python·jupyter
serve the people8 小时前
tensorflow tf.Module 的检查点Checkpoint机制
人工智能·python·tensorflow
serve the people8 小时前
TensorFlow 模型的 “完整保存与跨环境共享” 方案
人工智能·tensorflow·neo4j
serve the people1 天前
TensorFlow 中 “延迟变量创建(Deferred Variable Creation)” 机制
人工智能·python·tensorflow
serve the people1 天前
TensorFlow 中定义模型和层
人工智能·tensorflow·neo4j
serve the people2 天前
tensorflow tf.function 的 多态性(Polymorphism)
人工智能·python·tensorflow
聊天QQ:688238862 天前
TAC: 线性多智能体系统的时变编队队形跟踪与协同围捕研究
jupyter
serve the people2 天前
tensorflow tf.function 的两种执行模式(计算图执行 vs Eager 执行)的关键差异
人工智能·python·tensorflow