- 博客(155)
- 资源 (19)
- 收藏
- 关注
原创 高斯衰减方案汇总
3篇检测方法的文章中均包含高斯衰减相关的内容,记录一下,有问题再来看。CSP论文:GitHub - liuwei16/CSP: High-level Semantic Feature Detection: A New Perspective for Pedestrian Detection, CVPR, 2019High-level Semantic Feature Detection: A New Perspective for Pedestrian Detection, CVPR, 2019 -
2021-11-04 20:24:32
906
原创 时间戳转化
#!/usr/bin/python3# -*- coding: utf-8 -*import timedef str_to_stamp(time_str): # 转换显示格式 time1 = time.strptime(time_str, '%Y-%m-%d %H:%M:%S') # 转为时间戳 time2 = int(time.mktime(time1)) print(time2) return time2def stamp_to_str(...
2021-06-18 15:18:50
201
原创 pytorch dataloader is killed by signal or unexpected segmentation fault
tui jiahttps://www.zywvvd.com/2020/12/03/deep_learning/pytorch/dataloader_segmentation_fault/dataloader_segmentation_fault/
2021-06-16 11:11:18
278
原创 matplotlib显示图像翻转坐标
最近使用matplotlib显示数组发现了一个问题, matplotlib默认是y轴向右,x轴向下,导致输出的数组旋转了90°。修正方法: 使用xlim, ylim就好了,记一下,之后遇到类似的问题还可以来查。from matplotlib import pyplot as pltimport numpy as np# ax = plt.gca() # 没起作用,set_ticks_position的方法只能将x轴在上下变换,y轴在左右变换# ax.xaxis.set_ticks_posit
2021-04-24 19:15:05
4099
3
原创 不同版本pytorch训的模型之间的转化
写在开头: 本文仅记录自己遇到的问题,方便之后查阅。最近用不同版本的pytorch训了一些模型,但使用pytorch1.3加载pytorch1.6训练的模型失败,显示如下所示等一些乱七八糟的错误。但是没关系,因为本宝想到了一个好的解决办法,hiahiahia~1. pytorch1.6 加载它自身生成的模型是没问题的,然后把加载后的模型dict生成pickle文件, 代码如下:importpickleaspkl...
2021-03-17 16:44:10
4422
2
原创 linux 挂载硬盘
1 查看可用的硬盘:fdisk -l2 格式化为指定文件格式:mkfs -t ext4 /dev/xxx3 挂载硬盘到指定目录:mount /dev/xxx/data
2021-02-09 19:39:09
142
原创 python pytorch 释放显存资源
今天评测时,总莫名出现GPU OOM的问题。参考https://cloud.tencent.com/developer/article/1626387, 发现了一种在变量使用完之后释放显存资源的方法.torch.cuda.empty_cache()
2020-11-23 16:10:03
5943
原创 常用screen 命令
新建screen命令:screen -S name查看screen列表:screen -ls恢复指定screen:screen -r name删除screen: screen -S name-X quit
2020-06-24 15:06:58
1402
原创 多进程同步
from multiprocessing import Processimport osimport timedef func(name): print('Run child process %s (%s)...' % (name, os.getpid())) time.sleep(3) if __name__=='__main__': print('Par...
2019-04-23 17:22:39
513
原创 获取subprocess输出并转化为数字
vimprint_num.pyprint(111)vim test.pyimport subprocesscmd = ['python', 'print_num.py']p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)p.wait()out = p.stdout.re...
2019-04-18 18:59:23
718
转载 [转载]python 字符数字转换
本文参考自https://www.cnblogs.com/wuxiangli/p/6046800.html比如现在有字符串:x = '[[5], [6, 11], [0, 8, 9], [7, 13, 0, 1]]'想根据该字符串得到一个list,使用x_list = eval(x)即可以下内容转载自原博主文章:https://www.cnblogs.com/wuxiangli/p/...
2019-04-12 11:54:00
268
原创 SyntaxError: non-default argument follows default argument
错误信息:def avg_pool(self, inputs, op_type, output_channel=None, pooling_size): ^SyntaxError: non-default argument follows default argument 解决办法:python中函数中的所有默认参数的字段均应该写在不含默认值参...
2019-01-06 17:43:25
859
原创 pickle 序列化与反序列化
废话不多说,直接上代码import pickleclass Person: def __init__(self, name, age, job): self.name = name self.age = age self.job = job def work(self): print(self.name)...
2018-12-27 15:00:18
438
原创 pytorch指定使用的gpu设备
最近在使用pytorch写程序,想在指定的GPU设备上执行。假设函数func( )使用到了GPU设备:则在func()函数内部或者调用func()的地方加上:os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)我之前尝试在此处添加torch.cuda.set_device(self.gpu_id),没作用,记录下。...
2018-12-27 11:26:29
3586
原创 python 在一个py文件中调用另一个文件夹下py文件模块
假设现在的文件夹结构如下:-- src |-- dir1 | -- file1.py |-- dir2 | -- file2.py若要在src文件夹下执行dir2文件夹下的file2.py,python ./dir2/file2.py但file2.py中import dir1.file1此时,未避免出现 No module named '...
2018-12-25 20:33:26
17113
5
原创 conda 使用
下载Anacondahttps://www.anaconda.com/download/#macos; 选择系统,python版本等linux下sh anaconda.sh进行安装创建名为pytorch的环境,conda create -n pytorch pip python=2.7environment location: /home/gaosiqi/anaconda2/env...
2018-11-01 12:17:23
668
转载 pytorch 获取tensor维度信息
参考https://stackoverflow.com/questions/46826218/pytorch-how-to-get-the-shape-of-a-tensor-as-a-list-of-int>>> import torch>>> from torch.autograd import Variable>>> from ...
2018-10-18 20:35:29
54528
原创 批量重命名大量文件
参考自《linux shell 脚本攻略(第2版)》将一个文件夹下所有后缀为JPEG的文件重命名为后缀为jpg的文件,文件名不变。当文件夹下的文件数量太多时,使用普通的方法会报错: Argument list too long.for img in `find . -name '*.JPEG' -type f`do new_name=${img%.*} mv "$img" "...
2018-10-17 15:55:39
985
原创 磁盘挂载
将磁盘挂载到某目录下:mount /dev/sdb1 /home/ssd1 (将磁盘/dev/sdb1挂载到/home/ssd1目录下)! 在linux系统操作时要特别注意挂载目录。比如若已有其他磁盘挂载在/home目录下,这时再将设备/dev/sdb1挂载到/home,使用df -h查看磁盘信息,发现之前/home路径下的文件不见了。不过只是挂载点变了,之前的文件并没有真正的...
2018-09-14 12:36:11
425
原创 编译学习
VERBOSE=1make编译的时候加上选项VERBOSE=1可在编译时显示详细信息./configure --prefix=/home/caffe2/third/ffmpeg4_0_2/ffmpeg_install/ --disable-x86asm --enable-shared
2018-09-11 10:17:24
220
转载 批量删除软链接
原文地址:https://www.librehat.com/batch-delete-soft-links/ 版权归原作者所有,我只是材料的搬运工。。。记载下来,方便以后查询学习。 1. 删除[PATH]路径下的所有软链接:find -type l -delete [PATH]2. 如果是要删除失效的软链接,需要加上一个-L参数,表示追踪软链接:find ...
2018-08-24 14:49:04
5099
1
原创 make, cmake等编译相关
编译时指定指定c++特性:在CMakeList.txt中添加行:add_definitions(-std=c++11)指定安装路径的三种方式:./configure --prefix=" "cmake -DCMAKE_INSTALL_PREFIX=" "make install DESTDIR=" "...
2018-08-22 18:33:51
254
原创 python 查看redis安装版本
import redisprint redis.VERSION这样打印的是python中安装的redis版本
2018-08-17 12:09:16
3146
1
转载 python mpi学习
可参考:https://docs.it4i.cz/software/mpi/mpi4py-mpi-for-python/可使用rank获得进程的id号from mpi4py import MPIcomm = MPI.COMM_WORLD print "Hello! I'm rank %d from %d running in total..." % (comm.rank, comm.s...
2018-08-06 16:38:40
505
转载 python redis 断开连接
参考自https://github.com/andymccurdy/redis-py/issues/681r.connection_pool.disconnect()
2018-07-28 17:44:39
7822
原创 python redis 删除keys()
redis函数详解可参考https://redis-py.readthedocs.io/en/latest/redis官方文档中对delete函数的解释如下:delete(*names)[source]Delete one or more keys specified by names 可先将你redis中的keys全部打印出来,将无用的keys删除。这里给出删除redis...
2018-07-28 14:46:42
11522
转载 python redis 多机之间共享数据
本文转自https://opensource.com/article/18/4/how-build-hello-redis-with-python,成果归原作者所有,我只是材料的搬运工为方便以后的学习查找,记载下来,嘻嘻。。 首先保证python已安装redispython -m pip install redisredis共享数据步骤:1. 导入redis库2. 定义...
2018-07-25 17:31:36
1080
转载 python tcp socket编程相关
可参考https://gist.github.com/kevinkindom/108ffd675cb9253f8f71作者写的很清晰。
2018-07-24 11:04:11
179
原创 tensorflow 获取graph中的所有tensor
[n.name for n in tf.get_default_graph().as_graph_def().node]摘自https://stackoverflow.com/questions/36883949/in-tensorflow-get-the-names-of-all-the-tensors-in-a-graph
2018-07-20 15:44:24
17081
1
原创 tensorflow 仅初始化指定的variables及未初始化的variables
1. 已知variables v0,v1,v2,对特定的variables进行初始化可使用以下方法:initialize_op = tf.variables_initializer([v0,v1,v2])sess.run(initialize_op) 2. restore graph 进行了fine_tuning, 但仍保留restored weights,仅对新的未被初始化的tens...
2018-07-20 14:46:05
2124
转载 tensorflow统计graph中的trainable_variables
最简单的做法: 转自: https://blog.csdn.net/feynman233/article/details/79187304, 版权归原作者所有。print(np.sum([np.prod(v.get_shape().as_list()) for v in tf.trainable_variables()]))另有篇博客讲解的很详细:原文地址https://blog.csd...
2018-07-19 20:07:17
2095
转载 python中引号的区别
可参考https://blog.csdn.net/woainishifu/article/details/76105667博主写的很棒!
2018-07-19 18:35:25
316
The Matrix Cookbook(Petersen and Pedersen)
2017-10-20
cuda8.0_cuda_c_programming_guide_2017version
2017-10-19
vim配置文件及molokai.vim主题
2016-12-29
Computer Architecture: A Quantitative Approach(5th edition)
2016-09-04
高级体系结构:量化研究方法(第五版)中文版
2016-09-04
人工智能 一种现代的方法(第三版)答案(Stuart J. Russell, Peter Norvig著)
2016-05-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人