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

相关推荐
rengang6614 小时前
25-TensorFlow:概述Google开发的流行机器学习框架
人工智能·机器学习·tensorflow
QMY5205202 天前
TikTok 独立 IP 解决方案:独享静态住宅 IP + 环境隔离 + 粘性会话
大数据·jupyter·数据挖掘·数据分析·postman·1024程序员节
Cosmoshhhyyy3 天前
Jupyter Notebook运行Milvus Lite
ide·jupyter·milvus
盼小辉丶3 天前
TensorFlow深度学习实战——链路预测
深度学习·tensorflow·图神经网络
Cosmoshhhyyy4 天前
macOS环境安装jupyter notebook(极简版)
ide·macos·jupyter
java1234_小锋5 天前
TensorFlow2 Python深度学习 - 模型保存与加载
python·深度学习·tensorflow·tensorflow2
java1234_小锋5 天前
TensorFlow2 Python深度学习 - 生成对抗网络(GAN)实例
python·深度学习·tensorflow·tensorflow2
QMY5205205 天前
深度优先遍历策略
macos·jupyter·postman
JJJJ_iii6 天前
【机器学习05】神经网络、模型表示、前向传播、TensorFlow实现
人工智能·pytorch·python·深度学习·神经网络·机器学习·tensorflow
woshihonghonga6 天前
PyTorch矩阵乘法函数区别解析与矩阵高级索引说明——《动手学深度学习》3.6.3、3.6.4和3.6.5 (P79)
人工智能·pytorch·python·深度学习·jupyter·矩阵