python
文章平均质量分 60
orzchenyuming
曾梦想仗剑走天涯,后来工作忙没有去
展开
-
mmdetection训练自己的数据
配置环境安装pytorch环境安装mmcvgit clone https://github.com/open-mmlab/mmcv.gitcd mmcvpip install .(是的你没看错,这里就是有个 . )安装mmdetectiongit clone https://github.com/open-mmlab/mmdetection.gitcd mmdetectionpython setup.py develop安装完成训练自己的数据(如cascade rcnn)原创 2021-07-14 13:08:55 · 451 阅读 · 0 评论 -
Faster RCNN pytroch训练问题:Warning: NaN or Inf found in input tensor.
problem在自己的数据(voc格式)上训练Faster RCNN(https://github.com/jwyang/faster-rcnn.pytorch)就出现了loss=nan的问题。在Pascal voc和coco上训练Faster RCNN都正常。reason可能是learning rate太大,调小learning rate。最有效的方法是learning rate设为0,看看是不是还有nan的问题。大概率是自己的数据有问题(我的数据是voc格式),voc获取左边后是要减1的原创 2020-12-18 16:36:20 · 7941 阅读 · 3 评论 -
python程序命令行输出记录到log文件中
$ python xxx.py args1 >> data/log.txt 第一条命令的含义是:将xxx.py这个python文件中print()原本输出到console的内容重定向到"data/log.txt"文件中。(“>>”是追加,“>”是直接写入,即会发生覆盖);$ python xxx.py args1 | tee -a data/log.txt第二条命令使用了tee命令,在保证xxx.py文件运行时将print内容输出到控制台的同时,还把这些内容保存在"dat原创 2020-12-10 11:51:55 · 4195 阅读 · 0 评论 -
pytorch 牺牲计算速度减少显存使用量
牺牲计算速度减少显存使用量https://oldpan.me/archives/how-to-use-memory-pytorch原创 2019-03-06 10:22:03 · 372 阅读 · 0 评论 -
混淆矩阵(confusion matrix)
混淆矩阵(Confusion Matrix)分析https://blog.csdn.net/yutao03081/article/details/79111024可视化混淆矩阵import matplotlib.pyplot as pltimport numpy as npfrom sklearn.metrics import confusion_matrixdef plot_conf...原创 2019-02-28 18:02:02 · 1350 阅读 · 0 评论 -
Pytorch 细节记录:初始化方法......
https://www.cnblogs.com/king-lps/p/8570021.html原创 2019-01-15 15:32:32 · 630 阅读 · 0 评论 -
keras配置theano/tensorflow GPU
GPU的cuda环境自行配置Anoconda 自行安装创建conda环境conda create -n keras python=3.5安装theanoconda install theano安装tensorflow-gpuconda install tensorflow-gpu配置keras的backen,keras默认的backen是tensorflowvim ...原创 2018-12-06 13:24:57 · 447 阅读 · 0 评论 -
requires_grad和volatile
每个Tensor都有两个标志:requires_grad和volatile。它们都允许从梯度计算中精细地排除子图,并可以提高效率。requires_grad如果有一个单一的输入操作需要梯度,它的输出也需要梯度。相反,只有所有输入都不需要梯度,输出才不需要。如果其中所有的变量都不需要梯度进行,后向计算不会在子图中执行。x = Variable(torch.randn(5, 5))y = V...原创 2018-11-08 16:23:21 · 1664 阅读 · 0 评论 -
jupyter notebook远程连接
https://blog.csdn.net/simple_the_best/article/details/77005400原创 2018-11-01 14:49:18 · 362 阅读 · 0 评论 -
Ubuntu16安装Nivdia独立显卡驱动和分辨率配置
#### 1.从附加驱动选项中选择最新的显卡驱动,应用改变。 安装成功之后重启系统。 #### 2。在搜索菜单搜索Nvidia ,打开英伟达配置程序NVIDIA X Server Settings。如果没有屏幕对应的分辨率,随意选择一个分辨率和刷新频率,并单击按钮Save to X configration file,保存当前配置。注意保存路径为/etc/X11/xorg....原创 2018-04-18 15:54:23 · 652 阅读 · 0 评论 -
jupyter notebook 添加 conda 环境
1. 安装ipykernelconda install ipykernel2. 激活conda环境source activate cym3. 将环境写入notebook的kernel中python -m ipykernel install --user --name 环境名 --display-name “python 环境名”python -m ipykernel inst...原创 2018-10-16 15:22:22 · 8487 阅读 · 1 评论 -
Ubuntu命令行分屏神器:tmux
安装1.1 直接安装sudo apt-get install tmux可以直接用上面命令安装,不同的系统安装的版本不同,14.04对应 tmux 1.8;16.04对应 tmux 2.1。因为后面安装插件,要求tmux>=2.1, 所以ubuntu 14.04的朋友请选择后面的安装方式(16.04的小伙伴随意)。1.2 tar.gz 安装从 https://github.c...原创 2018-09-28 12:05:36 · 2399 阅读 · 1 评论 -
Pytorch: AlexNet在不同的layer使用不同的learning rate
对于一个network:class AlexNet(nn.Module):def __init__(self, num_classes=1000): super(AlexNet, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 64, kernel_size=11, stride=4, p...原创 2018-09-27 15:56:14 · 372 阅读 · 0 评论 -
pytorch余弦退火,learning rate 衰减
lr_scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=5,eta_min=4e-08)lr_scheduler.step()官网:https://pytorch.org/docs/0.3.1/optim.html#torch.optim.lr_scheduler.CosineAnnealingLRExampl...原创 2018-09-18 12:36:42 · 17107 阅读 · 0 评论 -
Python文件\文件夹操作
1、open一个文件 查了资料,关于open()的mode参数: file = open(filename, mode) file.close() ‘r’:读 ‘w’:写 ‘a’:追加 ‘r+’ == r+w(可读可写,文件若不存在就报错(IOError)) ‘w+’ == w+r(可读可写,文件若不存在就创建) ‘a+’ ==a+r(可追加可写,文件若不存在就创建) 对应的,...原创 2018-09-09 19:10:11 · 169 阅读 · 0 评论