model.show_result()导致jupyter lab提示服务似乎挂掉,但会立刻重启
实验1代码,不加model.show_result:
%reload_ext autoreload
%autoreload 2
%matplotlib inline
from mmseg.apis import inference_segmentor, init_segmentor
import mmcv
import os
os.environ[“KMP_DUPLICATE_LIB_OK”]=“TRUE”
config_file = ‘mmsegmentation/configs/unet/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py’
checkpoint_file = ‘mmsegmentation/checkpoints/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes_20211210_145204-6860854e.pth’
model = init_segmentor(config_file, checkpoint_file, device=‘cuda:2’)
img = ‘adjust20151019205737_FK108_1_6300_180000_B1_G3__noise0.02__flipv.png’ # or img = mmcv.imread(img), which will only load it once
result = inference_segmentor(model, img)
jupyte lab正常运行!!
实验2代码:
%reload_ext autoreload
%autoreload 2
%matplotlib inline
from mmseg.apis import inference_segmentor, init_segmentor
import mmcv
import os
os.environ[“KMP_DUPLICATE_LIB_OK”]=“TRUE”
config_file = ‘mmsegmentation/configs/unet/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py’
checkpoint_file = ‘mmsegmentation/checkpoints/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes_20211210_145204-6860854e.pth’
model = init_segmentor(config_file, checkpoint_file, device=‘cuda:2’)
img = ‘adjust20151019205737_FK108_1_6300_180000_B1_G3__noise0.02__flipv.png’ # or img = mmcv.imread(img), which will only load it once
result = inference_segmentor(model, img)
model.show_result(img, result, show=True)
model.show_result(img, result, out_file=‘result3.jpg’, opacity=0.5)
jupyter lab提示服务似乎挂掉,但会立刻重启
实验代码3,注释掉model.show_result(img, result, show=True):
%reload_ext autoreload
%autoreload 2
%matplotlib inline
from mmseg.apis import inference_segmentor, init_segmentor
import mmcv
import os
os.environ[“KMP_DUPLICATE_LIB_OK”]=“TRUE”
config_file = ‘mmsegmentation/configs/unet/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py’
checkpoint_file = ‘mmsegmentation/checkpoints/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes_20211210_145204-6860854e.pth’
model = init_segmentor(config_file, checkpoint_file, device=‘cuda:2’)
img = ‘adjust20151019205737_FK108_1_6300_180000_B1_G3__noise0.02__flipv.png’ # or img = mmcv.imread(img), which will only load it once
result = inference_segmentor(model, img)
#model.show_result(img, result, show=True)
model.show_result(img, result, out_file=‘result3.jpg’, opacity=0.5)
代码运行正常,生成result3.jpg
可见model.show_result(img, result, show=True)是导致jupyter lab服务挂掉的原因
其他替代方法:show_result_pyplot
%reload_ext autoreload
%autoreload 2
%matplotlib inline
from mmseg.apis import inference_segmentor, init_segmentor,show_result_pyplot
from mmseg.core.evaluation import get_palette
import mmcv
import os
os.environ[“KMP_DUPLICATE_LIB_OK”]=“TRUE”
config_file = ‘mmsegmentation/configs/unet/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py’
checkpoint_file = ‘mmsegmentation/checkpoints/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes_20211210_145204-6860854e.pth’
model = init_segmentor(config_file, checkpoint_file, device=‘cuda:2’)
img = ‘adjust20151019205737_FK108_1_6300_180000_B1_G3__noise0.02__flipv.png’ # or img = mmcv.imread(img), which will only load it once
result = inference_segmentor(model, img)
model.show_result(img, result, out_file=‘result4.jpg’, opacity=0.5)
show_result_pyplot(model, img, result, get_palette(‘cityscapes’))
model.show_result()导致jupyter lab提示服务似乎挂掉,但会立刻重启相关推荐
- jupyter 代码提示_Jupyter lab安装R支持时错误提示: exited with code 127解决办法
在Jupyter lab安装R支持时错误提示:jupyter-client has to be installed but "jupyter kernelspec --version&quo ...
- Jupyter Lab——使用tqdm.notebook.tqdm时没有出现进度条,提示“HBox(children=(FloatProgress……”
1 致谢 感谢网友 Mihai Chelaru在 Stack Overflow上的回答 链接如下: https://stackoverflow.com/questions/57343134/jupyt ...
- Chrome浏览器/Jupyter lab下载文件提示已经被禁止
参考资料: https://github.com/jupyterlab/jupyterlab/issues/7539 先说一下问题的表现,使用Chrome浏览器查看jupyter lab.当想用jup ...
- centos树莓派版本安装ssh_Raspberry Pi 4B(树莓派4B)远程ssh和jupyter lab环境搭建记录
本人新手,若有不当之处,还望指正. 插上hdmi显示器,先搞通ssh才能做其他事情 修改密码:在终端输入passwd可以修改密码 树莓派SSH默认处于关闭状态,使用之前需要先将其开启. 1.打开树莓派 ...
- Jupyter Lab 密码登录、远程访问
Jupyter Lab 是一款给予 Web 的可交互式集成开发环境(IDE). 相信很多人已经用过 Jupter Notebook 了,其最令人诟病的可能就是 Jupter Notebook 无法图形 ...
- jupyter lab添加插件可以查看python file中函数定义等
文章目录 0. 更新jupyter lab OK 安装jupyterlab2.3.1版本 开启用户验证 折腾0 折腾1 折腾2 1. jupyterlab-go-to-definition 2. ls ...
- jupyter lab环境搭建
jupyter lab安装和配置 环境:ubuntu21.0 python 3.9环境 1.安装 2.代码提示工具(LSP)安装 3.远程登陆配置 4.扩展安装(代码折叠等) 环境:ubuntu21. ...
- 【二】jupyter lab插件相关问题
文章目录 一.前言 二.插件介绍 2.1 jupyterlab-kite 2.2 debugger 2.3 geojson-extension 2.4 jupyterlab-toc 2.5 jupyt ...
- Jupyter Lab通过安装插件利用autopep8等实现快速格式化代码
概述 Jupyter Lab本身并不支持代码格式化.目前,比较成熟的解决方案就是使用jupyterlab_code_formatter插件. jupyterlab_code_formatter支持Py ...
- 大幅提高生产力:你需要了解的十大Jupyter Lab插件
点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 下一代数据科学开发环境 Jupyter Lab 应该怎么用?让我们 ...
最新文章
- 统计java文件中的代码行数
- 你可能不清楚的 Vue Router 深度用法(一)
- cppan 命令_逐步解說:在命令列上編譯原生 C++ 程式
- 「后端小伙伴来学前端了」关于 Vue中 Slot 插槽的使用,实用且也是组件中必会的一个知识,另外也可以实现父子组件之间通信
- 增强for循环、Map接口遍历、可变參数方法
- ros构建机器人运动学模型_古月私房课 | ROS机械臂开发中的主角MoveIt!
- 设计模式 工厂方法_工厂方法设计模式
- 云计算技术背后的天才程序员:Open VSwitch鼻祖Martin Casado
- MVP模式在Android中的应用(附UML高清大图,使用RecyclerView举例)
- Java 算法 等差数列
- 查询blob字段_一次注解开发实战-我使用注解对微服务的跨库查询做了封装
- DOM节点操作大全(一)
- 如何理解互斥锁、条件锁、读写锁以及自旋锁?(转载)
- 精品、好用、优质、黑科技网站推荐
- 虚拟主机与云服务器有什么区别,我们应该如何选择
- 12月21诛仙服务器维护,12月31日全服停机更新维护公告
- 你的编程能力从什么时候开始突飞猛进?
- 使用Mybatis相关类生成sql语句
- 程序员吐槽_程序员在地铁上写代码被路人吐槽:有什么好装的!网友评论炸锅了!...
- 【python第五章——函数】
热门文章
- 字节跳动否认完成支付牌照收购 或是基于央行批准的不确定性
- 表单格式化插件jquery.serializeJSON
- 火车采集 PHP插件 post,火车采集器2010版PHP插件增加扩展的方法
- Bottled Water: 实时集成postgresql与kafka
- KMP,LCA(XJT Love Strings,玲珑杯 Round#8 A lonlife 1079)
- Kubernetes和Jenkins——基于Kubernetes构建Jenkins持续集成平台
- 《英语语法新思维 基础版1》读书笔记(一)
- 深耕教学 常研常新——海门市高二历史教研活动掠影
- java gui 文本框_【Java GUI】文本框和文本区
- 网页只有在服务器上才能打开,为什么你的电脑只能上QQ,而打不开网页?我来告诉你...