笔记
3DYour
这个作者很懒,什么都没留下…
展开
-
类似typora的 MarkText 图片
类似typora的 MarkText 图片原创 2022-07-23 10:58:46 · 382 阅读 · 1 评论 -
python打印print彩色信息&pypi上传自己的python包
python 打印彩色信息原创 2022-04-21 17:09:30 · 1060 阅读 · 0 评论 -
torch.index_select
在指定维度上取出指定索引数据。import torcha=torch.tensor([[0,1,2], [3,4,5], [6,7,8] ])i=torch.tensor([0,0,1,2,2])c=torch.index_select(a,0,i)print(c)a是三行三列的。这里指定维度为行,也就是取第0行第0行第1行第2行第2行输出大小为5x3输出:原创 2022-04-08 16:29:28 · 250 阅读 · 0 评论 -
visual studio background download 关闭
某天我的电脑风扇疯狂响,打开任务管理器,发现visual studio background download进程导致的,这是一个visual studio的更新程序,如何关闭它呢?参考:(2 封私信 / 80 条消息) 如何彻底阻止Visual Studio 2019自动更新? - 知乎 (zhihu.com)右击开始图标,依次选择“计算机管理”-“任务计划程序”-“任务计划程序库”-“Microsoft”-“Visual Studio”-“Updates”,把“BackgroundDownl原创 2022-04-04 16:53:18 · 10549 阅读 · 0 评论 -
pycharm调试out of memory
在训练一个模型的时候,训练了几个batch后突然报错“out of memory ”。心想不应该啊,如果是显存不够的话一开始就应该报错,于是在pycharm中调试代码,在debug前,先打开gpustatwatch --color -n1.0 gpustat --out -c #-n 后面参数是几秒刷新一次于是边执行代码,一边看显存变化,找到问题所在。...原创 2022-04-04 16:27:36 · 1891 阅读 · 0 评论 -
torch.einsum详解
torch.einsum详解 - 知乎 (zhihu.com)原创 2022-03-25 15:54:28 · 905 阅读 · 0 评论 -
pycharm 调试pytorch代码:unable to get repr for <class torch.Tensor>
取值范围超了。a=torch.tensor([1,2])print(a[-3])print(a[3])原创 2022-03-24 21:45:27 · 1543 阅读 · 0 评论 -
torch.gather()
作用:取出特定维度索引的值。torch.gather(input,dim,index,out=None,sparse_grad=False)举个例子import torcha=torch.tensor([[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15],])index=torch.tensor([[0,2],[3,4],[1,4]])print(torch.gather(a,1,index))输出tensor([[ 1, 3]原创 2022-03-24 20:21:08 · 2619 阅读 · 0 评论 -
保存tensor到csv中
1 首先将GPU上的tensor复制一封到cpu上:save_occ=occ_mask.data.cpu()2 再将高纬度tensor转换到2维度的tensor,save_occ=occ_mask.data.cpu()with open("1.csv","ab") as f: # for i in range(occ_mask.shape[1]): # one_layer=occ_mask[1,:,:] np.savetxt(f,save_occ[0.原创 2022-03-23 20:02:52 · 4801 阅读 · 0 评论 -
python数组乘以标量小错误
M=[ [ 2, 2, 1, 0, 0], [ 0,-2,-2,-2, 2], [ 1, 2, 2, 2,-1], [ 2, 1, 0, 1,-1], [0.5,2, 2, 1, 0], [ 0, 1, 1, 1,-1], [-2, 2, 2, 1, 1], [ 2, 1, 2, 1,-1],]本想给每个元素乘以5,于是就写成a=5*Mprint(a)输出:[[7.3890561 7.3890561 2.7182.原创 2022-03-21 09:17:39 · 1043 阅读 · 0 评论 -
pytorch梯度累加探索
举个简单例子,,求一次梯度为2x=2 (x=1)import torchx = torch.tensor(1.0, requires_grad=True)y1 = x ** 2y1.backward()print(x.grad)输出tensor(2.)若我们再求一次导import torchx = torch.tensor(1.0, requires_grad=True)y1 = x ** 2y1.backward()print(x.grad)y1.ba...原创 2022-03-18 00:57:23 · 1897 阅读 · 0 评论 -
Anaconda中安装Pytorch 速度太慢解决办法
本文参考:Anaconda中安装Pytorch 速度太慢解决办法_ 蜗牛在听雨的博客-CSDN博客_conda install pytorch太慢怎么办【陆续排坑】解决conda下载速度慢的问题:更换国内源_Xiao_Spring的博客-CSDN博客_conda更改下载源使用conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch安装pytorch原创 2022-03-13 17:29:31 · 10934 阅读 · 0 评论 -
git fetch 与git pull的区别(菜鸟总结)
建议先看:详解git pull和git fetch的区别 - 知乎经过我自己实践发现。远程仓库有:a.py ,b.py本地仓库1:a.py,c.py如果本地仓库1中的a.py和原车仓库中的a.py相同本地仓库1中执行git fetch origin mastergit merge origin master本地仓库1变为:a.py ,b.py,c.py相当于本地仓库1执行git pull ,此时git pull =(git fetch + git merge) ,都..原创 2021-10-12 14:55:19 · 260 阅读 · 0 评论 -
yolov3修改保存weights间隔
yolov3修改保存weights间隔打开darknet/src/detector.c搜索‘save’找到 if(i%100==0){#ifdef GPU if(ngpus != 1) sync_nets(nets, ngpus, 0);#endif char buff[256]; sprintf(buff, "%s/%s.backup", backup_directory, base); save_原创 2021-07-16 09:50:20 · 921 阅读 · 1 评论 -
error gnutls_handshake() failed: Error in the pull function.
fatal: unable to access ‘https://github.com/wang-xinyu/tensorrtx.git/’: gnutls_handshake() failed: Error in the pull function.试试把https改为gitgit clone -b trt4 git://github.com/wang-xinyu/tensorrtx.git原创 2021-06-21 23:54:15 · 429 阅读 · 0 评论 -
YOLOF代码复现全过程
环境:Ubuntu 18.04 python 3.8 Torch1.8 cuda10.2听说可以不安装mish-cuda,那就先不装吧,装的越多,错的越多,怕了怕了怕了~(py38_to18) wgp@wgp:~/python/env_py38_torch18$ git clone https://github.com/chensnathan/YOLOF.git正克隆到 'YOLOF'...remote: Enumerating objects: 85, done.remote: Counting原创 2021-05-24 21:27:45 · 1704 阅读 · 0 评论 -
detectron2痛苦的安装记录
/bin/sh: 1: :/usr/local/cuda/bin/nvcc: not found环境 :ubuntu18.04我装了cuda10.0和cuda10.2,用的软连接,现在把删除软连接,修改~/.bashrcadded by cuda8.0#export CUDA_HOME=/usr/local/cuda#export PATH=PATH:PATH:PATH:CUDA_HOME/bin#export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64原创 2021-05-24 10:57:51 · 1095 阅读 · 0 评论 -
Linux Ubuntu 桌面卡住
alt+f2,然后输入r,回车。亲测有效原创 2021-04-24 11:16:24 · 331 阅读 · 0 评论