linux系统如何在jupyter notebook里面使用tensorflow

Linux下Tensorflow-jupyter安装,并远程使用jupyter 基础操作 Linux内核版本查看:cat /proc/version Linux系统版本查看:lsb_release -a GPU型号查看:lspci | grep -i nvidia 返回结果是十六进制,可在下面网址查询 查询十六进制GPU型号:http://pci-ids.ucw.cz/mods/PC/10de?action=help?help=pci 根据GPU型号,下载Nvidia驱动:https://www.nvidia.com/download/ind 阅读详情

本文转载自:

Using TensorFlow through Jupyter (Python 3)

查找了许多解决方案均遇到问题,看到国外的一个解决方案,亲测完美解决。

问题描述:

Apologies in advance, I think the issue is quite perplexing!

I would like to use TensorFlow through Jupyter, with a Python3 kernel.

However the command import tensorflow as tf returns the error: ImportError: No module named tensorflow when either Python2 or Python3 is specified as the Jupyter kernel.

  • I have Python 2 and Python 3 installed on my Mac and can access bothversions through Terminal.
  • I installed TensorFlow for Python 3, however I can only access it via Python 2 on the Terminal.

As such, this question is really two-fold:

  1. I want to get TensorFlow working with Python3
  2. ...which should lead to TensorFlow working with Jupyter on the Python3 terminal.
解决方案:

I had the same problem and solved it using the tutorial Using a virtualenv in an IPython notebook. I'll walk you through the steps I took.

I am using Anaconda, and I installed a new environment tensorflow using these instructions at tensorflow.org. After that, here is how I got tensorflow to work in a Jupyter notebook:

  1. Open Terminal
  2. Run source activate tensorflow. You should now see (tensorflow) at the beginning of the prompt.
  3. Now that we are in the tensorflow environment, we want to install ipython and jupyter in this environment: Run

    conda install ipython 
    

    and

    conda install jupyter
    
  4. Now follow the instructions in the tutorial linked above. I'll repeat them here with a bit more information added. First run

    ipython kernelspec install-self --user 
    

    The result for me was Installed kernelspec python3 in /Users/charliebrummitt/Library/Jupyter/kernels/python3

  5. Run the following:

    mkdir -p ~/.ipython/kernels
    

    Then run the following with <kernel_name> replaced by a name of your choice (I chose tfkernel) and replace the first path (i.e., ~/.local/share/jupyter/kernels/pythonX) by the path generated in step 4:

    mv ~/.local/share/jupyter/kernels/pythonX ~/.ipython/kernels/<kernel_name>
    
  6. Now you'll see a new kernel if you open a Jupyter notebook and select Kernel -> Change kernel from the menu. But the new kernel will have the same name as your previous kernel (for me it was called Python 3). To give your new kernel a unique name, run in Terminal

    cd ~/.ipython/kernels/tfkernel/
    

    and then run vim kernel.json to edit the file kernel.json so that you replace the value of "display_name" from the default (Python 3) to a new name (I chose to call it "tfkernel"). Save and exit vim by typing :wq while in command mode.

  7. Open a new Jupyter notebook and type import tensorflow as tf. If you didn't get ImportError then you are ready to go!

TensorFlow从入门到实践:TensorFlow入门-安装配置与基础实践 TensorFlow环境配置与线性回归实践摘要 本文介绍了TensorFlow开发环境的配置方法,涵盖Windows、macOS和Linux系统的安装步骤,推荐使用虚拟环境隔离项目。详细讲解了Jupyter Notebook和Google Colab两种交互式开发工具的使用方式。通过一个线性回归实例,展示了如何用TensorFlow构建单层神经网络:生成随机数据,创建Sequential模型,使用Adam优化器和MSE损失函数进行1000轮训练,并可视化预测结果。该示例完整演示了TensorFlow的基本工 阅读详情

相关推荐

Linux(redhat)CUDA,CUDNN,tensorflow-gpu离线安装

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 安装GPU驱动 nvidia-smi lsmod | grep nouveau sudo rpm -ivh nvidia-diag-driver-local-repo-rhel7-XXXXXX.x86_64.rpm ++++++++++++++++++++++++++++...

LinFengOnlyOne的博客 1547

Linux搭建深度学习平台tensorflow,并使用jupyter notebook远程访问服务器。

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言 一、pandas是什么? 二、使用步骤 1.引入库 2.读入数据 总结 前言 本文介绍如何搭建深度学习平台,并使用jupyter notebook进行运用。 提示:以下是本篇文章正文内容,下面案例可供参考 一、Tensorflow 最好新建一个虚拟环境,搭建深度学习平台最让人头疼的莫过于各种包版本兼容问题,我试了两个版本,很幸运第二个版本就可以了(如下)。首先建议不要安装过高的版本.

qq_41832354的博客 1862

Prokka实战:10分钟搞定细菌基因组注释(附详细参数解析)

本文深入解析Prokka细菌基因组注释工具的核心参数与实战策略。通过拆解其集成化工作流程,详细解读物种分类、功能注释、输出控制等关键参数,并提供快速初筛、高质量发表、质粒注释及批量处理四种典型场景的高效参数组合方案,帮助用户精准掌控注释过程,将原始序列转化为有价值的生物学见解。

weixin_29271053的博客 444

Linux系统使用jupyter

在Linux系统中,利用Anaconda创建Pytorch虚拟环境,远程配置Jupyter notebook。

m0_73085867的博客 5639

YOLOv11【第二章:核心模块进阶篇·第28节】DynamicHead动态检测头设计!

🏆 本文收录于专栏 《YOLOv11实战:从入门到深度优化》。本专栏围绕 YOLOv11 的改进、训练、部署与工程优化 展开,系统梳理并复现当前主流的 YOLOv11 实战案例与优化方案,内容目前已覆盖 分类、检测、分割、追踪、关键点、OBB 检测 等多个方向。

**My Coding Family** 1万+

UG\NX二次开发 分割曲线

分割曲线没有ufun函数?那就换一种思路实现。

王牌飞行员_里海的博客 1147

Linux下 jupyter notebook的使用

关于虚拟环境的创建及管理见我另一篇文章pyenv管理python环境 我的系统版本:Centos7.9 在所在虚拟环境内安装jupyter notebook,同时也会自动安装ipython (lwj361) [python@lura ~/lwj/projects/cmdb]$pip install jupyter 安装成功提示: 修改jupyter notebook密码: [python@lura ~/lwj/projects/cmdb]$jupyter notebook --help [python

带你去吃小豆花的博客 7227

3、图像中文字信息提取技术全解析

本文全面解析了图像中文字信息提取(Text Information Extraction,TIE)的技术原理、挑战及应用领域。详细介绍了图像中三种主要文字形式:场景文字、字幕文字和文档文字的特点及提取难点。系统阐述了TIE技术的主要流程步骤,包括文字检测、定位、提取与增强、识别等关键阶段,并对主流技术方法进行了分类比较,包括基于连通组件、边缘、纹理等方法的优缺点分析。文章还介绍了多种其他提取技术,如二值化方法、混合方法、基于梯度的方法等,并提出了一种基于立体帧的新型场景文字提取方法,通过实验验证了该方法在召

ll5678的博客 119

在linux服务器上配置Jupyter notebook

然后我自己的本地电脑(windows)上会自动打开一个网页(火狐的hhh),就OK啦。# 设置Jupyter监听的ip地址,修改为*表示监听所有ip地址。(3)修改Jupyter_notebook_config.py该配置文件。(1)首先,执行如下命令,安装jupyter notebook。我是结合了两篇博客的内容来配置的,所以看我下面写的就好!(2)然后,生成jupyter配置文件。(4)运行如下命令打开Jupyter。要将这串密码保存下来,放入。该命令执行后会生成一个。测试一下是可以运行的!

qq_73361455的博客 1046

有限元ABAQUS软件安装后管理员身份运行报错:Cannot connect to license server system...如何解决?

🏆本文收录于 《全栈Bug调优(实战版)》 专栏,该专栏专注于分享我在真实项目开发中遇到的各类疑难Bug及其深层成因,并系统提供高效、可复现的解决思路和实操方案。无论你是刚入行的新手开发者,还是拥有多年项目经验的资深工程师,本专栏都将为你提供一条系统化、高质量的问题排查与优化路径,助力你加速成长,攻克技术壁垒,迈向技术价值最大化与职业发展的更高峰🚀!

**My Coding Family** 2075

万字长文带你由浅入深夯实ARM汇编基础——汇编指令及寻址方式最全梳理(附示例)!

见到汇编就害怕?读完这篇,扫除汇编拦路虎!!(示例丰富,可做手册,随手查阅!)

车载系统攻城狮 1万+

将 Docker 踢出群聊后,Kubernetes 还能否欢快地蹦跶吗?

前言前两天闹得沸沸扬扬的事件不知道大家有没有听说,Google 竟然将Docker踢出了Kubernetes的群聊,不带它玩了。。。我这里简单描述下,Kubernetes 是通过...

程序猿DD 752

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

linux-windows系统打开jupyter notebook方法-避免kernel错误-避免import tensorflow error出错

文章目录jupyter notebook 简介1.windows打开jupyter2. ubuntu打开jupyter notebook3.可能出现的错误解决方法3.1 jupyter import tensorflow error出错3.2 kernel error3.3 忽略tensorflow FutureWarning jupyter notebook 简介 jupyter 是新手及可视化输出比较好用的网页版编辑器,可以看到每一步输出结果 我是双系统都装的anaconda3-python3.6-

HJZ11的博客 631

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

在Linux Ubuntu中安装TensorFlow与Keras

Step1 连接到continuum的网址 直接在linux中打开官网的网页,找到Anaconda for linux,选择相应版本,右键,选取Copy Link Location Step2 下载Anaconda 在“终端”中输入 wget 再按空格键 然后将之前保存在网址粘贴在此处 ...

thwwu的博客 556

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

搭配linux+Anaconda+TensorFlow+Keras+GPU环境

搭配linux+Anaconda+TensorFlow+Keras+GPU环境 1. 安装anaconda 注意:linux 系统不同,命令可能略有差异,如口令前sudo。以下都是如此。 将安装包copy到Server(服务器一般都是linux系统)的根目录下, bash Anaconda3-5.2.0-Linux-x86_64.sh 或者, wget https://repo.anaconda....

qq_43237588的博客 471

Linux下安装tensorflow

环境准备 下载anaconda, https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh 安装 [root@localhost ~]# wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh [root@localhost ~]# bash Anaconda3-2019.10-Linux-x86_64.sh 1 2 以上信息提示,都进行.

建建的博客 796

Deepin Linux安装TensorFlow

在Deepin Linux下边安装TensorFlow 在google chrome上利用Jupyter Notebook来访问tensorflow

u013452296的专栏 3626

redhat下的 cpu-tensorflow安装及远程开启notebook

tensorflow实战上面用的系统是ubuntu的系统,但是有人说红帽的系统运行速度更快,so就跑到红帽上面了,都是linux吗,感觉都差不多吧。 安装的过程就是按照《tensorflow实战》这本书上一步步走的,但是问题也有几个,对于我这linux菜鸟查了半天博客。 下载anaconda3 4.2.0         去官网上找,只发现了最新的 anaconda5.0.0 最新版本,担心

a602232180的博客 554

Linux安装TensorFlow

Linux系统下打开jupyter notebook文件 在命令行下输入: source activate root 然后再输入: jupyter notebook & jupyter lab Linux 中查看python的安装路径 方法1:whereis python 查看所有python的路径,不止一个 方法2:which python 查看当前使用的python路径 ...

一个机器学习的学习之旅 450

三、在Linux Ubuntu下安装Anaconda及TensorFlow与Keras(超级详细哦)

三、在Linux Ubuntu下安装Anaconda及TensorFlow与Keras(超级详细哦)1、安装Anaconda1.1、复制Anaconda的下载网址。2.2、下载Anaconda3-4.2.0-Linux-x86_64.sh1.3、安装Anaconda1.4、编辑 ~/.bashrc加入模块路径1.5、使 ~/.bashrc修改生效1.6、查看Python版本。2、安装TensorF...

qq_41760767的博客 6030

ubuntu16.04安装tensorflow-gpu以及pytorch教程(完整教程)

        实验室来了新电脑,重新搭框架。于是想整理一下教程,涉及搭框架的所有过程,主要是把别人的方式汇总。一步搞定所有过程!!! 1.安装linux系统 教程链接:https://blog.youkuaiyun.com/flyyufenfei/article/details/79187656 2.安装显卡驱动: 教程链接:https://www.linuxidc.com/Linux/2016-1...

yang_daxia的博客 2024

Tensorflow实战学习(四十六)【TensoFlow开发环境,Mac,Ubuntu,Linux,Windows,CPU版本】

下载TensorFlow https://github.com/tensorflow/tensorflow/tree/v1.1.0 。Tags选择版本,下载解压。 pip安装。pip,Python包管理工具,PyPI(Python Packet Index) https://pypi.python.org/pypi 。 Mac环境。 安装virtualenv。virtualenv,Pytho

极客神殿 917

Linux上部署含有第三方库的python脚本(anaconda3,TensorFlow2.0)

Linux上部署含有第三方库的python脚本(anaconda3,TensorFlow2.0)

Dlihctcefrep的博客 519

Cifar10数据集的下载和导入,windows和linux(基于tensorflow)

许多博主都提到了如何下载,在哪下载,但是到了最重要的一步:如何导入数据集,都是草草带过,这对于新手来说很不友好,因此写下这篇文章。 环境 tensorflow2.0 jupyter notebook编辑器 下载 可以在官网下载: Cifar10链接 一般情况下,通过高校的网络下载速度非常快,但如果因为各种原因下载太慢,可以通过以下地址下载: Cifar10链接2 下载好之后,将文件放入datasets文件夹中(不需要解压),这里建议为cifar10数据集创建一个文件夹,层级如图所示(项目.ipynb文件与d

sweet&spicy的博客 1万+
上一篇: ubuntu系统无法访问磁盘解决办法
下一篇: Oracle物理结构、逻辑结构、内存结构
Waitfou
博客等级 码龄10年 61粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值