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

相关推荐
Awesome Baron5 小时前
《Learning Langchain》阅读笔记8-RAG(4)在vector store中存储embbdings
python·jupyter·chatgpt·langchain·llm
爱编程的鱼1 天前
Windows 各版本查找计算机 IP 地址指南
人工智能·windows·网络协议·tcp/ip·tensorflow
无心水1 天前
基础服务系列-Jupyter Notebook 支持Java
ide·python·jupyter
蓑笠翁0011 天前
超分辨率重建实战:从原理到Keras/TensorFlow完整实现
tensorflow
zcongfly2 天前
【随手记】jupyter notebook绘制交互式图像
ide·python·jupyter
kong³2 天前
Sklearn 与 TensorFlow 机器学习实用指南-第八章 降维-笔记
机器学习·tensorflow·sklearn
惜棠2 天前
在任意路径下简单开启jupyter notebook
ide·python·jupyter
shimly1234563 天前
如何让 vscode jupyter 访问 terminal 的环境变量?
ide·vscode·jupyter
码上飞扬3 天前
使用Java调用TensorFlow与PyTorch模型:DJL框架的应用探索
java·pytorch·tensorflow
Awesome Baron4 天前
《Learning Langchain》阅读笔记2-基于 Gemini 的 Langchain PromptTemplate 实现方式
jupyter·chatgpt·langchain·llm