-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
226 lines (209 loc) · 34.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Jason的博客世界</title><meta name="author" content="Jason"><meta name="copyright" content="Jason"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="涸辙之鲋,旦暮成枯;人而无志,与彼何殊。"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://jasonfengjx.github.io/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: undefined,
translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
copy: {
success: 'Copy successfully',
error: 'Copy error',
noSupport: 'The browser does not support'
},
relativeDate: {
homepage: false,
post: false
},
runtime: 'days',
dateSuffix: {
just: 'Just',
min: 'minutes ago',
hour: 'hours ago',
day: 'days ago',
month: 'months ago'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
source: {
justifiedGallery: {
js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
}
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'Jason的博客世界',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-01-21 23:16:33'
}</script><noscript><style type="text/css">
#nav {
opacity: 1
}
.justified-gallery img {
opacity: 1
}
#recent-posts time,
#post-meta time {
display: inline !important
}
</style></noscript><script>(win=>{
win.saveToLocal = {
set: function setWithExpiry(key, value, ttl) {
if (ttl === 0) return
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = url => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
document.head.appendChild(script)
})
win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onerror = reject
link.onload = link.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
link.onload = link.onreadystatechange = null
resolve()
}
document.head.appendChild(link)
})
win.activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><meta name="generator" content="Hexo 7.0.0-rc2"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://s3.bmp.ovh/imgs/2022/10/15/8da5bc3ad7cffd3a.jpeg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">16</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">2</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 链接</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></li><li><a class="site-page child" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></li></ul></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://s3.bmp.ovh/imgs/2022/10/15/0fd7b8845fc461a0.png')"><nav id="nav"><span id="blog-info"><a href="/" title="Jason的博客世界"><span class="site-name">Jason的博客世界</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 链接</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></li><li><a class="site-page child" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Jason的博客世界</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/Jasonfengjx" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:201900303043@mail.sdu.edu.cn" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2024/01/20/yolov8%E4%BB%A3%E7%A0%81%E8%A7%A3%E8%AF%BB-%E6%95%B0%E6%8D%AE%E7%AF%87/" title="yolov8代码解读--数据篇"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="yolov8代码解读--数据篇"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/01/20/yolov8%E4%BB%A3%E7%A0%81%E8%A7%A3%E8%AF%BB-%E6%95%B0%E6%8D%AE%E7%AF%87/" title="yolov8代码解读--数据篇">yolov8代码解读--数据篇</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2024-01-20T15:16:52.000Z" title="Created 2024-01-20 23:16:52">2024-01-20</time></span></div><div class="content">类继承关系ultralytics/data/base.py 有BaseDataset类,这个类是数据集处理的基类。
包括YOLODataset、SemanticDataset都继承这个类
基类方法分析get_img_files12345678910111213141516171819202122232425262728293031323334353637383940414243def get_img_files(self, img_path): """Read image files.""" # 定义一个名为get_img_files的方法,用于读取图像文件 try: f = [] # image files # 创建一个空列表f,用于存储找到的图像文件路径 # 下面的循环处理img_path,这可以是单个路径或路径列表 for p in img_path if isinstance(img_path, list) else [img_path]: ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2023/12/29/600%E6%9D%A1linux%E5%91%BD%E4%BB%A4/" title="600条linux命令"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="600条linux命令"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/12/29/600%E6%9D%A1linux%E5%91%BD%E4%BB%A4/" title="600条linux命令">600条linux命令</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-12-29T08:55:21.000Z" title="Created 2023-12-29 16:55:21">2023-12-29</time></span></div><div class="content">1来源:https://blog.csdn.net/l1028386804/article/details/117917710
今天,带来一篇 Linux 命令总结的非常全的文章,也是我们平时工作中使用率非常高的操作命令,命令有点多,建议小伙伴们可以先收藏后阅读。
1. 基本命令123456789101112131415161718192021222324uname -m 显示机器的处理器架构uname -r 显示正在使用的内核版本dmidecode -q 显示硬件系统部件(SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性hdparm -tT /dev/sda 在磁盘上执行测试性读取操作系统信息arch 显示机器的处理器架构uname -m 显示机器的处理器架构uname -r 显示正在使用的内核版本dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI)hdparm -i /dev/hda 罗列一个磁盘的架构特性hdparm -tT /dev/sda 在磁盘上执行测试性读取操作cat /proc/cpuinfo 显示CPU ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2023/12/28/jason2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="jason2023年终总结"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="jason2023年终总结"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/12/28/jason2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="jason2023年终总结">jason2023年终总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-12-28T13:36:17.000Z" title="Created 2023-12-28 21:36:17">2023-12-28</time></span></div><div class="content">科研
AI今年对深度学习有了一些理解,从之前的数据层面的增删、清洗等到模型搭建,今年已经可以完成有代码模型的轻易复现以及根据自己数据做调整,主要是理解到了data_loader的作用。对于pytorch和tf都有所涉猎,至少已经都用到了,具体精细化修改还是要继续研究。
模型层面,今年学了两种主要的模型,yolo系列和vae系列的模型,初步学会了搭建与复现、修改的方法。有时间我会更新yolo系列算法的改进。比如更换backbone、neck、head等,添加n2n的注意力机制等。但是对于模型的调优方面感觉还是要继续深入的学习。
对于loss的理解更深一层,首先基于一个事实就是我们的模型主要关注最终指标,这个指标可以是简单的ACC、Recall、AUC等,也可以是专业领域的index,但是我们要做的事把loss和index之间的联系找到。跟一个协和的网友聊天、探讨问题,非cs的同学主要可能没有理解最终index的重要,感觉这是一个理解的点,另一个就是在一个例子群项目中,loss其实比较玄学,有的时候只是有那个趋势的关系就会work,所以要多多尝试。具体比如vae中的JS loss可以进行多 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2023/12/16/202312bug/" title="202312bug"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="202312bug"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/12/16/202312bug/" title="202312bug">202312bug</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-12-16T13:04:50.000Z" title="Created 2023-12-16 21:04:50">2023-12-16</time></span></div><div class="content">cuda显存超界1torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 4.07 GiB (GPU 1; 23.65 GiB total capacity; 20.39 GiB already allocated; 2.77 GiB free; 20.42 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
最一开始看不懂为什么已经分配而显卡上却没有进程在跑,后来直接认为它是一个显存超界的bug
RuntimeError: a Tensor with 6 elements cannot be converted to Scalar计算loss的时候不知道 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2023/12/16/self-in-python-code/" title="self in python code"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="self in python code"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/12/16/self-in-python-code/" title="self in python code">self in python code</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-12-16T12:59:18.000Z" title="Created 2023-12-16 20:59:18">2023-12-16</time></span></div><div class="content">由于对面向对象编程很长时间没有复习过,昨天写Dataloader的时候,有个方法没写好,原因是,类内方法调用的时候,需要调用有self的方法,但是我还没试下调用类外方法的事例。
1. self 关键字代表实例自身:在Python类的方法中,self 是一个指向实例本身的引用。
访问实例属性和方法:使用 self 来访问类的属性和其他方法。
在定义方法时必须:在类的实例方法定义中,self 必须作为第一个参数,代表调用该方法的对象实例。
2. 类内方法定义在类内部:这些方法定义在类的定义中。
访问方式:通过类的实例(使用 self)或者直接通过类名(对于静态方法和类方法)来访问。
可以访问类属性和方法:类内方法可以访问通过 self 的同一实例的其他方法和属性。
**自动传递 self**:当实例方法被调用时,实例本身自动作为第一个参数传递(即 self)。
3. 类外方法定义在类外部:这些是独立的函数,定义在类定义之外,通常在全局作用域中。
全局作用域:类外方法通常在其定义的模块的全局作用域中有效,如果是在不同模块,则需要导入。
4. 方法和函数的调用类内调用类外方法:类内的方法可以自 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2023/11/03/python2310%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/" title="python2310学习记录"><img class="post-bg" src="https://pic.imgdb.cn/item/6544dfc0c458853aef675af9.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="python2310学习记录"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/11/03/python2310%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/" title="python2310学习记录">python2310学习记录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-11-03T11:50:19.000Z" title="Created 2023-11-03 19:50:19">2023-11-03</time></span></div><div class="content">1 subprocess模块subprocess是Python的一个标准库模块,它允许你从Python代码中启动新的应用程序或命令,与它们交互并获取它们的输出。这个模块提供了一个简单而一致的接口来替代旧的模块和函数,如os.system()、os.spawn*()等。
主要功能:
启动新进程:你可以使用subprocess来启动新的系统命令或应用程序。
与进程交互:你可以发送输入到进程,并从进程中读取输出。
等待进程完成:你可以等待进程完成,并获取其返回码。
主要函数和类:
**subprocess.run()**:从Python 3.5开始,这是执行子进程并等待其完成的推荐方法。
**subprocess.call()**:运行命令,等待它完成,然后返回返回码。
**subprocess.check_call()**:与call()类似,但如果命令返回非零值,则会引发异常。
**subprocess.check_output()**:运行命令并返回其输出。如果命令返回非零值,则会引发异常。
**subprocess.Popen()**:这是一个更强大的类,允许你启动并与子进程交互。 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2023/10/23/prompt%E5%B7%A5%E7%A8%8B/" title="prompt工程"><img class="post-bg" src="https://pic.imgdb.cn/item/65379c28c458853aefb44be1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="prompt工程"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/10/23/prompt%E5%B7%A5%E7%A8%8B/" title="prompt工程">prompt工程</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-10-23T09:26:37.000Z" title="Created 2023-10-23 17:26:37">2023-10-23</time></span></div><div class="content">前沿今年,ChatGPT等大型模型在各个领域展示了其广泛的应用前景,显示出了惊人的潜能。值得注意的是,prompt的设计和质量对模型输出的效果有着重要影响。回想起GPT-3.5初次亮相时,其功能尚不如现在之丰富。而今,GPT-4带来了三大亮点:首先,它可以提供更为详尽的文本回答;其次,它具备了基于爬虫技术的网页浏览功能;最后,它还新增了绘图功能,成为一款真正的多模态模型。接下来,我将为大家列举几个实用且有趣的ChatGPT prompt示例。
效率提升prompt1. Write Multithreaded Functions 14. 编写多线程函数
Prompt: I want you to act as a coder. Can you help me parallelize this code across threads in Python?提示:我希望你充当编码员。你能帮我在 Python 中的线程中跨线程并行化这段代码吗?
2. Write Documentation 28. 编写文档Credit: @svpino 信用:@svpino
Prompt: I want y ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2023/10/13/%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E4%B8%8E%E5%8F%AF%E8%A7%86%E5%8C%96%E4%BB%A3%E7%A0%81/" title="数据处理与可视化代码"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="数据处理与可视化代码"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/10/13/%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E4%B8%8E%E5%8F%AF%E8%A7%86%E5%8C%96%E4%BB%A3%E7%A0%81/" title="数据处理与可视化代码">数据处理与可视化代码</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-10-13T13:19:12.000Z" title="Created 2023-10-13 21:19:12">2023-10-13</time></span></div><div class="content">项目介绍一个数据分析项目,所使用的代码都是普通代码,没有技术含量,chatgpt可以无痛做到,本文在此只提供和总结一下分析数据的基本思路。
代码与释义数据爬虫从互联网获取数据当然是要从爬虫开始,使用python可以很轻松的写出一个可用的爬虫。本文以某网站为例,合法爬取部分数据用于学习交流。
引入库包以及文件路径
123456789101112131415161718import requests import pprintimport csvimport timekeyword = 'eye'f = open('./data/'+keyword+'.csv', mode='a', encoding='utf-8', newline='')csv_writer = csv.DictWriter(f, fieldnames=[ '标题', '品牌', '原价', '折扣&#x ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2023/10/11/Python%E7%BB%98%E5%88%B6Venn%E5%9B%BE/" title="Python绘制Venn图"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Python绘制Venn图"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/10/11/Python%E7%BB%98%E5%88%B6Venn%E5%9B%BE/" title="Python绘制Venn图">Python绘制Venn图</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-10-11T10:16:24.000Z" title="Created 2023-10-11 18:16:24">2023-10-11</time></span></div><div class="content">Python绘制Venn图pyvenn这里介绍一个使用python绘制Venn图的方法,常见的绘制Venn图有两种方法,本文介绍第二种,它提供了2-6个子集时的Venn图绘制方法。
下面是demo:
12345678910111213141516171819202122232425262728293031import matplotlibmatplotlib.use('Agg')import matplotlib.pyplot as pltimport vennlabels = venn.get_labels([range(10), range(5, 15)], fill=['number', 'logic'])fig, ax = venn.venn2(labels, names=['list 1', 'list 2'])fig.savefig('betterpyvenn/images/venn2.png', bbox_inches='tight' ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2023/10/08/deprecated-and-remove/" title="deprecated and remove"><img class="post-bg" src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="deprecated and remove"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/10/08/deprecated-and-remove/" title="deprecated and remove">deprecated and remove</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2023-10-08T11:09:09.000Z" title="Created 2023-10-08 19:09:09">2023-10-08</time></span></div><div class="content">经过1234AttributeError: module 'numpy' has no attribute 'int'.`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.The aliases was originally deprecated in NumPy 1.20; for ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://s3.bmp.ovh/imgs/2022/10/15/8da5bc3ad7cffd3a.jpeg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Jason</div><div class="author-info__description">涸辙之鲋,旦暮成枯;人而无志,与彼何殊。</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">16</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">2</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/Jasonfengjx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/Jasonfengjx" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:201900303043@mail.sdu.edu.cn" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>Announcement</span></div><div class="announcement_content">欢迎来到Jason的博客世界</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2024/01/20/yolov8%E4%BB%A3%E7%A0%81%E8%A7%A3%E8%AF%BB-%E6%95%B0%E6%8D%AE%E7%AF%87/" title="yolov8代码解读--数据篇"><img src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="yolov8代码解读--数据篇"/></a><div class="content"><a class="title" href="/2024/01/20/yolov8%E4%BB%A3%E7%A0%81%E8%A7%A3%E8%AF%BB-%E6%95%B0%E6%8D%AE%E7%AF%87/" title="yolov8代码解读--数据篇">yolov8代码解读--数据篇</a><time datetime="2024-01-20T15:16:52.000Z" title="Created 2024-01-20 23:16:52">2024-01-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/12/29/600%E6%9D%A1linux%E5%91%BD%E4%BB%A4/" title="600条linux命令"><img src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="600条linux命令"/></a><div class="content"><a class="title" href="/2023/12/29/600%E6%9D%A1linux%E5%91%BD%E4%BB%A4/" title="600条linux命令">600条linux命令</a><time datetime="2023-12-29T08:55:21.000Z" title="Created 2023-12-29 16:55:21">2023-12-29</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/12/28/jason2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="jason2023年终总结"><img src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="jason2023年终总结"/></a><div class="content"><a class="title" href="/2023/12/28/jason2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="jason2023年终总结">jason2023年终总结</a><time datetime="2023-12-28T13:36:17.000Z" title="Created 2023-12-28 21:36:17">2023-12-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/12/16/202312bug/" title="202312bug"><img src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="202312bug"/></a><div class="content"><a class="title" href="/2023/12/16/202312bug/" title="202312bug">202312bug</a><time datetime="2023-12-16T13:04:50.000Z" title="Created 2023-12-16 21:04:50">2023-12-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2023/12/16/self-in-python-code/" title="self in python code"><img src="https://pic.imgdb.cn/item/65379000c458853aef989ef0.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="self in python code"/></a><div class="content"><a class="title" href="/2023/12/16/self-in-python-code/" title="self in python code">self in python code</a><time datetime="2023-12-16T12:59:18.000Z" title="Created 2023-12-16 20:59:18">2023-12-16</time></div></div></div></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>Tags</span></div><div class="card-tag-cloud"><a href="/tags/%E5%B7%A5%E7%A8%8B/" style="font-size: 1.1em; color: #999">工程</a> <a href="/tags/%E7%A7%91%E7%A0%94/" style="font-size: 1.1em; color: #999">科研</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>Archives</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/01/"><span class="card-archive-list-date">January 2024</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/12/"><span class="card-archive-list-date">December 2023</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/11/"><span class="card-archive-list-date">November 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/10/"><span class="card-archive-list-date">October 2023</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/09/"><span class="card-archive-list-date">September 2023</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/09/"><span class="card-archive-list-date">September 2022</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>Info</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">Article :</div><div class="item-count">16</div></div><div class="webinfo-item"><div class="item-name">Run time :</div><div class="item-count" id="runtimeshow" data-publishDate="2024-01-21T15:16:33.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">UV :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">PV :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">Last Push :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-01-21T15:16:33.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2024 By Jason</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">欢迎来到Jason的博客世界</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="Switch Between Traditional Chinese And Simplified Chinese">繁</button><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"><script>window.typedJSFn = {
init: (str) => {
window.typed = new Typed('#subtitle', Object.assign({
strings: str,
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50,
}, null))
},
run: (subtitleType) => {
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/dist/typed.umd.min.js').then(subtitleType)
}
} else {
subtitleType()
}
}
}
</script><script>function subtitleType () {
if (true) {
typedJSFn.init(["不积跬步,无以至千里;不积小流,无以成江海。"])
} else {
document.getElementById("subtitle").textContent = "不积跬步,无以至千里;不积小流,无以成江海。"
}
}
typedJSFn.run(subtitleType)</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>