![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
技术小白
Jamiechoi
这个作者很懒,什么都没留下…
展开
-
ubuntu apt 下载所有依赖包
服务器开发通常不能联网,我们需要利用一个能上网的服务器下载依赖包apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends 包名 |grep -v "^ ")然后dpkg -i *.deb即可完成安装参考:how-to-download-all-depe原创 2022-05-25 13:43:56 · 4051 阅读 · 0 评论 -
ONNX固定batch size
import onnxdef change_input_dim(model): sym_batch_dim = "batch" actual_batch_dim = 4 graph = model.graph nodes = list(graph.input) + list(graph.value_info) + list(graph.output) for node in nodes: if not len(node.type.tensor_ty原创 2022-02-22 16:27:46 · 1778 阅读 · 2 评论 -
ONNX修改节点的值
#新节点conv1_node = onnx.helper.make_node( name="Conv_40", # Name is optional. op_type="Conv", # Must follow the order of input and output definitions. # https://github.com/onnx/onnx/blob/rel-1.9.0/docs/Operators.md#inputs-2---3 inputs=[原创 2022-01-28 16:53:11 · 4184 阅读 · 0 评论 -
PyTorch转onnx转TRT中不支持的操作
PyTorch训练的模型,在转为ONNX再转为TRT模型时,有一些操作不支持假设输入是AvgPooling以后的特征torch.nn.functional.normalize会引入Expand操作解决方案:F.normalize(features, p=2, dim=1)替换为features.div(features.norm(p=2, dim=1, keepdim=True))size()会引入Gather操作解决方案:onnxsim转化features.view(feat原创 2021-06-09 16:14:51 · 1235 阅读 · 0 评论 -
Error response from daemon: could not select device driver ““ with capabilities: [[gpu]]
Nvidia Docker安装后,使用镜像创建容器时出错,错误提示:Error response from daemon: could not select device driver "" with capabilities: [[gpu]]需要先把nvidia-container-runtime添加到apt里面sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \ sudo apt-key ad原创 2021-03-02 14:47:06 · 329 阅读 · 0 评论 -
自定义shell powerline 状态栏 显示时间
因为服务器没有管理员权限,装不了zsh,只能在conda里面装一个powerline用注意,conda里面不要使用conda安装,要使用pip安装,这样所有环境下都可以享用powerline安装和基本配置教程:Powerline:给 Vim 和 Bash 提供更棒的状态行和提示信息 有时候想要在命令行输出时间,好让自己知道这个命令是什么时候跑的,搜了一下powerline show tim...原创 2019-12-23 20:11:42 · 781 阅读 · 0 评论 -
caffe ImportError: libhdf5_hl.so.100: cannot open shared object file: No such file or directory
很奇怪,编译的时候不报错,但是Import的时候报错了ldd 看caffe的so,发现hdf5的so not found,但locate却发现是有这个so的看了路径发现路径不在LD_LIBRARY_PATH里面只需要把这个路径加进去然后sudo ldconfig就可以了...原创 2019-10-25 22:47:57 · 1482 阅读 · 0 评论 -
ubuntu 已有gcc 5.5 的情况下 安装5.4
直接使用apt-get install gcc-5是不行的,因为已经安装了5.5通过apt-cache policy 是可以查到5.4的那么我们直接尝试用sudo apt install gcc-5=5.4.0-6ubuntu1~16.04.10安装,但是报如下错误:这个时候就把所有依赖都加到install后面:sudo apt build-dep gcc-5=5.4.0-6ubun...原创 2019-10-25 21:20:53 · 4501 阅读 · 0 评论 -
理解0/1背包问题
背包问题想了好几天都没想明白,今天根据代码看了一下dp table,终于想明白了。给自己记录一下,免得后面忘记。先贴代码:# A Dynamic Programming based Python Program for 0-1 Knapsack problem # Returns the maximum value that can be put in a knapsack of capac...原创 2019-09-17 11:17:19 · 221 阅读 · 0 评论 -
微软2017年预科生计划在线编程笔试 题目1 : Legendary Items
题目1 :Legendary Items所有题目在此:https://hihocoder.com/contest/mstest2017march/problems答案:https://github.com/hiho-coder/msft-2017-online-test-solution/blob/master/README.md这道题关键在于数学期望值的计算。如果使用题目给定的公式...原创 2017-03-31 22:20:02 · 897 阅读 · 0 评论 -
pip版本问题:pip2指向python3
无论重新安装 apt-get install python-pip或者修改pip的第一行也没用直接python2 -m pip install xxx 就好了原创 2019-04-01 21:24:00 · 3886 阅读 · 1 评论 -
python+opencv 添加包边文字
cv2.putText(img, label, (x0, y1-5), font, 0.6, (255, 255, 255), 2, cv2.LINE_AA) cv2.putText(img, label, (x0, y1-5), font, 0.6, (0, 0, 0), 0, cv2.LINE_AA)原创 2019-03-13 11:01:13 · 2361 阅读 · 0 评论 -
远程桌面+连接ubuntu(linux)
server端/usr/lib/vino/vino-server 开启vnc服务器参考:https://askubuntu.com/questions/4474/enable-remote-vnc-from-the-commandlineclient端使用Remmina或者Remote Desktop进行连接,直接输入server的ip即可...原创 2019-03-05 13:20:02 · 2264 阅读 · 1 评论