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

相关推荐
mftang2 天前
TensorFlow Lite Micro:面向TinyML系统的嵌入式机器学习推理框架
人工智能·机器学习·tensorflow
xing-xing2 天前
魔搭社区(ModelScope)下载模型文件
python·jupyter·llm
中微极客10 天前
TensorFlow模型量化实战:从精度到延迟的优化指南
人工智能·python·tensorflow
敲代码的猴先生12 天前
论文分享 | TensorAbuse:通过滥用TensorFlow API将AI模型转化为恶意软件
人工智能·python·语言模型·tensorflow·论文笔记
想你依然心痛15 天前
TensorFlow Lite Micro:在MCU上运行神经网络推理——量化、算子支持与内存优化
单片机·神经网络·tensorflow
红石程序员15 天前
python3.11配置tensorflow-gpu版本环境
人工智能·tensorflow·python3.11
yang_coder17 天前
juypter notebook启动ssl报错的处理记录
python·jupyter
菜板春1 个月前
jupyter入门-手册-特征探索
python·jupyter
冷小鱼1 个月前
TensorFlow 2.21 进阶实战:从训练优化到生产部署的完整指南
人工智能·pytorch·python·tensorflow
木叶子---1 个月前
前端打包出错
前端·人工智能·tensorflow