-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.xml
More file actions
232 lines (231 loc) · 23.8 KB
/
rss.xml
File metadata and controls
232 lines (231 loc) · 23.8 KB
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
227
228
229
230
231
232
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Study Notes</title>
<subtitle></subtitle>
<icon>http://longliveforfreedom.github.io/images/favicon.ico</icon>
<link>http://longliveforfreedom.github.io</link>
<author>
<name>Eren New</name>
</author>
<description></description>
<language>en</language>
<pubDate>Fri, 28 Feb 2025 15:11:57 +0800</pubDate>
<lastBuildDate>Fri, 28 Feb 2025 15:11:57 +0800</lastBuildDate>
<item>
<guid isPermalink="true">http://longliveforfreedom.github.io/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/</guid>
<title>Implement-HiVT-with-Latest-pytorch-and-pl-Version</title>
<link>http://longliveforfreedom.github.io/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/</link>
<pubDate>Fri, 28 Feb 2025 15:11:57 +0800</pubDate>
<description><![CDATA[ <h1 id="implementdeploy-hivt-with-latest-pytorchpytorch-lightning-version"><a class="anchor" href="#implementdeploy-hivt-with-latest-pytorchpytorch-lightning-version">#</a> Implement(deploy) HiVT with latest pytorch&amp;pytorch-lightning version</h1>
<ul>
<li>refer to <span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2tkZGIxMjM0L2FydGljbGUvZGV0YWlscy8xMzY4MzEyNTg=">https://blog.csdn.net/kddb1234/article/details/136831258</span>, <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3B5Zy10ZWFtL3B5dG9yY2hfZ2VvbWV0cmljL2lzc3Vlcy80MzU4">https://github.com/pyg-team/pytorch_geometric/issues/4358</span> and <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2d6ZXJ2ZWFzL212dHNfdHJhbnNmb3JtZXIvaXNzdWVzLzY4">https://github.com/gzerveas/mvts_transformer/issues/68</span></li>
<li>the official env of HiVT is pytorch 1.8, python 3.8, pytorch-geometric 1.7.2, pytorch-lightning 1.5.2 and cuda 11.1, which versions are too early. So, this blog will deploy HiVT with higher version of torch&amp;pl with python 3.10, pytorch 2.1.0, pytorch-lightning 2.0.3, PyG 2.3.1 and cuda 12.1.</li>
</ul>
<h1 id="preparation"><a class="anchor" href="#preparation">#</a> Preparation</h1>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">conda create -n HiVT python=3.10</span><br><span class="line">conda activate HiVT</span><br><span class="line">conda install pytorch==2.1.0 cudatoolkit=12.1 -c pytorch -c conda -forge</span><br><span class="line">conda install pytorch-geometric==2.3.1 -c rusty1s -c conda-forge</span><br><span class="line">conda install pytorch-lightning==2.0.3 -c conda-forge</span><br></pre></td></tr></table></figure>
<h1 id="modification-of-hivt-src"><a class="anchor" href="#modification-of-hivt-src">#</a> Modification of hivt src</h1>
<h2 id="trainpy"><a class="anchor" href="#trainpy">#</a> <span class="exturl" data-url="aHR0cDovL3RyYWluLnB5">train.py</span></h2>
<ul>
<li>the “gpus” in parser should be changed to “devices”</li>
</ul>
<img data-src="/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/1.png" class title="gpus">
<ul>
<li>the ArgoverseV1DataModule has no from_argoverse_args function any more, it can be input directly like:</li>
</ul>
<img data-src="/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/2.png" class title="datamodule">
<ul>
<li>similarly to the datamodule, pl.Trainer should also be fixed</li>
</ul>
<img data-src="/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/3.png" class title="trainer">
<h2 id="adepy"><a class="anchor" href="#adepy">#</a> <span class="exturl" data-url="aHR0cDovL2FkZS5weQ==">ade.py</span> and other metrics</h2>
<ul>
<li>the compute_on_step parameter is no need, just delete it from the input parameter of <strong>init</strong> function</li>
</ul>
<img data-src="/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/4.png" class title="metrics">
<ul>
<li>same applies to other py files in the metrics directory</li>
</ul>
<h2 id="local_encoderpy"><a class="anchor" href="#local_encoderpy">#</a> local_encoder.py</h2>
<p>the new version of nn.Transformer add a parameter is_causal so it should be added in the TemporalEncoder class, which employs nn.TransformerEncoder as transformer_encoder variable</p>
<img data-src="/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/5.png" class title="is_causal">
<h1 id="modification-of-pyg-code"><a class="anchor" href="#modification-of-pyg-code">#</a> Modification of PyG code</h1>
<p>find the <span class="exturl" data-url="aHR0cDovL2NvbGxhdGUucHk=">collate.py</span> in the directory .conda/envs/${your env name}/lib/python3.10/site-pacakages/torch_geometric/data/collate.py. Then find the get_incs function and delete the input variable ‘store’ of data.<strong>inc</strong>()</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd .conda/envs/$&#123;your env name&#125;/lib/python3.10/site-pacakages/torch_geometric/data</span><br><span class="line">gedit collate.py</span><br></pre></td></tr></table></figure>
<img data-src="/2025/02/28/Implement-HiVT-with-Latest-pytorch-and-pl-Version/6.png" class title="pyg">
<h1 id="others"><a class="anchor" href="#others">#</a> Others</h1>
<p>If you encounter problems about variables, add ‘**kwargs’ in forward() function may be help</p>
<h1 id="now-you-can-try-to-train-hivt-follow-the-official-doc"><a class="anchor" href="#now-you-can-try-to-train-hivt-follow-the-official-doc">#</a> Now you can try to train HiVT follow the official doc</h1>
<ul>
<li>official doc: <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL1ppa2FuZ1pob3UvSGlWVA==">https://github.com/ZikangZhou/HiVT</span></li>
</ul>
]]></description>
</item>
<item>
<guid isPermalink="true">http://longliveforfreedom.github.io/2024/11/06/hello-world/</guid>
<title>Hello World</title>
<link>http://longliveforfreedom.github.io/2024/11/06/hello-world/</link>
<pubDate>Wed, 06 Nov 2024 16:54:04 +0800</pubDate>
<description><![CDATA[ <p>Welcome to <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvLw==">Hexo</span>! This is your very first post. Check <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL2RvY3Mv">documentation</span> for more info. If you get any problems when using Hexo, you can find the answer in <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL2RvY3MvdHJvdWJsZXNob290aW5nLmh0bWw=">troubleshooting</span> or you can ask me on <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2hleG9qcy9oZXhvL2lzc3Vlcw==">GitHub</span>.</p>
<h2 id="quick-start"><a class="anchor" href="#quick-start">#</a> Quick Start</h2>
<h3 id="create-a-new-post"><a class="anchor" href="#create-a-new-post">#</a> Create a new post</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure>
<p>More info: <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvd3JpdGluZy5odG1s">Writing</span></p>
<h3 id="run-server"><a class="anchor" href="#run-server">#</a> Run server</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
<p>More info: <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvc2VydmVyLmh0bWw=">Server</span></p>
<h3 id="generate-static-files"><a class="anchor" href="#generate-static-files">#</a> Generate static files</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>
<p>More info: <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL2RvY3MvZ2VuZXJhdGluZy5odG1s">Generating</span></p>
<h3 id="deploy-to-remote-sites"><a class="anchor" href="#deploy-to-remote-sites">#</a> Deploy to remote sites</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>
<p>More info: <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvb25lLWNvbW1hbmQtZGVwbG95bWVudC5odG1s">Deployment</span></p>
]]></description>
</item>
<item>
<guid isPermalink="true">http://longliveforfreedom.github.io/2024/11/06/Deploy-My-Own-Blog/</guid>
<title>Deploy My Own Blog</title>
<link>http://longliveforfreedom.github.io/2024/11/06/Deploy-My-Own-Blog/</link>
<pubDate>Wed, 06 Nov 2024 13:39:36 +0800</pubDate>
<description><![CDATA[ <h1 id="deploy-my-own-blog-with-hexotheme-shoka-and-github"><a class="anchor" href="#deploy-my-own-blog-with-hexotheme-shoka-and-github">#</a> Deploy my own blog with hexo(theme: Shoka) and github</h1>
<h2 id="prepare"><a class="anchor" href="#prepare">#</a> Prepare</h2>
<ul>
<li>a github account</li>
<li>install Git(get ssh working) and Nodejs on your PC or Mac</li>
</ul>
<h2 id="hexo"><a class="anchor" href="#hexo">#</a> Hexo</h2>
<ul>
<li>install<br>
<code>sudo npm install -g hexo-cli</code> <br>
without sudo may encounter permission issues result in install fail</li>
<li>init your blog folder<br>
<code>hexo init blog</code> <br>
<code>cd blog</code></li>
</ul>
<img data-src="/2024/11/06/Deploy-My-Own-Blog/image.png" class title="opration">
<ul>
<li>install some dependencies<br>
<code>sudo npm install</code> <br>
<code>sudo npm install hexo-deployer-git --save</code></li>
<li>get writing root for blog file<br>
<code>sudo chmod -R 777 blog</code></li>
<li>preview your blog<br>
<code>hexo s</code> <br>
visit <span class="exturl" data-url="aHR0cDovL2xvY2FsaG9zdDo0MDAwLw==">http://localhost:4000/</span> you will see your blog page</li>
<li>(optional) download a theme from <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3RoZW1lcy8=">https://hexo.io/themes/</span> and move the file to /blog/themes</li>
<li>the Shoka theme is here <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2FtZWhpbWUvaGV4by10aGVtZS1zaG9rYQ==">https://github.com/amehime/hexo-theme-shoka</span></li>
</ul>
<h2 id="github-pages"><a class="anchor" href="#github-pages">#</a> Github pages</h2>
<ul>
<li>create a repository namely <span class="exturl" data-url="aHR0cDovL3VzZXJuYW1lLmdpdGh1Yi5pbw==">username.github.io</span></li>
<li>modify the deploy section in /root/_config.yml</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line"> type: git</span><br><span class="line"> repo: https://github.com/username/username.github.io.git</span><br><span class="line"> branch: main</span><br></pre></td></tr></table></figure>
<ul>
<li>after coding your blog, you can deploy it<br>
<code>hexo g</code> <br>
<code>hexo d</code></li>
<li>visit <span class="exturl" data-url="aHR0cDovL3VzZXJuYW1lLmdpdGh1Yi5pbw==">http://username.github.io</span> then you will see your blog</li>
</ul>
<h2 id="create-a-new-blog"><a class="anchor" href="#create-a-new-blog">#</a> Create a new blog</h2>
<p><code>hexo new &quot;new blog name&quot;</code> <br>
put the picture in file with the same name of the new blog</p>
<ul>
<li>note: the title should not include special symbol such as ‘&amp;’</li>
</ul>
<h2 id="back-up-the-source-code-in-another-branch-of-the-repo"><a class="anchor" href="#back-up-the-source-code-in-another-branch-of-the-repo">#</a> Back up the source code in another branch of the repo</h2>
<p>refer to <span class="exturl" data-url="aHR0cHM6Ly9ibG9nLjUxY3RvLmNvbS91XzE0MjMzMDM3LzU4MjQ1MjQ=">https://blog.51cto.com/u_14233037/5824524</span></p>
<ul>
<li>enter the .deploy_git(hidden file) folder<br>
<code>cd .deploy_git</code></li>
<li>create a branch called src<br>
<code>sudo git branch src</code></li>
<li>then copy the .git(also hidden) file to the blog path(parent directory)</li>
<li>associate the path to the repo<br>
<code>sudo git remote add origin https://github.com/username/username.github.io.git</code></li>
<li>run the command you will see the repo info<br>
<code>sudo git remote show origin</code></li>
<li>添加保存改动</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo git add .</span><br><span class="line">sudo git commit -m &quot;source code updata&quot;</span><br></pre></td></tr></table></figure>
<ul>
<li>change to the src branch<br>
<code>sudo git checkout src</code></li>
<li>pull your local source code to the repo<br>
<code>sudo git push origin src:src</code></li>
<li>every time update following commands are needed</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">sudo git add .</span><br><span class="line">sudo git commit -m &quot;xxx&quot;</span><br><span class="line">sudo git checkout src</span><br><span class="line">sudo git push origin src:src</span><br></pre></td></tr></table></figure>
]]></description>
</item>
<item>
<guid isPermalink="true">http://longliveforfreedom.github.io/2024/11/05/Remote-Control-with-RustDesk/</guid>
<title>Remote Control with RustDesk</title>
<link>http://longliveforfreedom.github.io/2024/11/05/Remote-Control-with-RustDesk/</link>
<pubDate>Tue, 05 Nov 2024 22:43:46 +0800</pubDate>
<description><![CDATA[ <h1 id="remote-control-with-rustdesk-and-zerotiermacbook-as-control-end-ubuntu-as-controlled-end-raspberrypi4b-as-relay-server"><a class="anchor" href="#remote-control-with-rustdesk-and-zerotiermacbook-as-control-end-ubuntu-as-controlled-end-raspberrypi4b-as-relay-server">#</a> Remote Control with rustdesk and zerotier(Macbook as control end, ubuntu as controlled end, raspberrypi4B as relay server)</h1>
<h2 id="preface"><a class="anchor" href="#preface">#</a> Preface</h2>
<ul>
<li>macbook: m1 pro</li>
<li>raspberry pi 4B with 4G ram and Ubuntu 20</li>
<li>linux PC with ubuntu 20.04</li>
<li>课题组的服务器在 1 楼,工位在 4 楼,因此需要远程。todesk 和向日葵免费版的都很糊而且 todesk 免费时长有限又需要经常登陆微信,不好用。</li>
</ul>
<h2 id="prepare"><a class="anchor" href="#prepare">#</a> Prepare</h2>
<h3 id="control-end"><a class="anchor" href="#control-end">#</a> Control end</h3>
<ul>
<li>download rustdesk for mac: 官网 https://rustdesk.com/,选择 macos arm64 下载</li>
<li>download zerotier(make sure that ssh is working)<br>
<code>curl -s https://install.zerotier.com | sudo bash</code></li>
</ul>
<h3 id="controlled-end"><a class="anchor" href="#controlled-end">#</a> Controlled end</h3>
<p>与控制端同理</p>
<h3 id="relay-server"><a class="anchor" href="#relay-server">#</a> Relay server</h3>
<ul>
<li>download zerotier as before</li>
<li>download rustdesk-server(Note that it’s not rustdesk, it’s rustdesk-server, i.e. the rustdesk server) in here <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3J1c3RkZXNrL3J1c3RkZXNrLXNlcnZlci9yZWxlYXNlcw==">https://github.com/rustdesk/rustdesk-server/releases</span>, download hbbs-arm64 and hbbr-arm64(raspberry pi is arm architecture) then unzip</li>
<li>pm2 is used to manage process hbbs and hbbr, so nodejs and npm are needed
<ul>
<li>install nodejs<br>
<code>$ sudo apt install nodejs</code></li>
<li>install npm<br>
<code>$ sudo apt install npm</code> <br>
<code>$ npm install -g n</code></li>
<li>install pm2<br>
<code>$ npm install pm2 -g</code> <br>
<code>$ pm2 completion install</code></li>
<li>check process list<br>
<code>$ pm2 ls</code></li>
</ul>
</li>
</ul>
<img data-src="/2024/11/05/Remote-Control-with-RustDesk/image.png" class title="pm list">
<ul>
<li>enter the directory hbbs and hbbr and run them respectively<br>
<code>$ cd /Rustdesk/rustdesk-server-hbbs_1.1.11-1_arm64/data/usr/bin</code> <br>
<code>$ pm2 start hbbs</code> <br>
<code>$ cd /Rustdesk/rustdesk-server-hbbr_1.1.11-1_arm64/data/usr/bin</code> <br>
<code>$ pm2 start hbbr</code></li>
<li>copy the key in the file with pub suffix in the hbbs folder and it will be used later</li>
<li>Open these ports on the firewall:
<ul>
<li>TCP(21115, 21116, 21117, 21118, 21119)</li>
<li>UDP(21116)</li>
</ul>
</li>
</ul>
<h3 id="zerotier"><a class="anchor" href="#zerotier">#</a> Zerotier</h3>
<p>Register a zerotier account(<span class="exturl" data-url="aHR0cHM6Ly93d3cuemVyb3RpZXIuY29tLw==">https://www.zerotier.com/</span>) and create a network. Join the network in all three devices. Log in to the zerotier official website, enter the network, tick these devices, and authorize them. Get the IP address of these 3 devices</p>
<h2 id="lets-go"><a class="anchor" href="#lets-go">#</a> Let’s Go</h2>
<img data-src="/2024/11/05/Remote-Control-with-RustDesk/image2.png" class title="rustdesk">
<p>In both of control end and controlled end, 点击 ID 旁边的三个点选择 Network,然后解锁,ID server 和 Relay server 均填入 relay server 的内网 IP,api server 不填,key 中填入此前保存的 hbbs key。Control end 中输入 controlled end 的 ID 即可连接。</p>
<h1 id="some-problems"><a class="anchor" href="#some-problems">#</a> Some Problems</h1>
<p>these may work<br>
<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3J1c3RkZXNrL3J1c3RkZXNrL2lzc3Vlcy80NDAjaXNzdWUtMTE5MTAyMDIyNQ==">https://github.com/rustdesk/rustdesk/issues/440#issue-1191020225</span></p>
<!-- ---
date: 2024-11-05 22:30:01
tags:
--- --> ]]></description>
</item>
</channel>
</rss>