yxlijun / pyramidbox.pytorch Goto Github PK
View Code? Open in Web Editor NEWPyramidbox implement with pytorch
Pyramidbox implement with pytorch
在你的code中,conv6的形式是:
conv6 = nn.Conv2d(512, 1024, kernel_size=3, padding=6, dilation=6)
但这个形式其实是SSD中的。
而在PyramidBox中,底层是基于S3FD中的VGG16。跟SSD没关系。所以conv6的形式应该是:
conv6 = nn.Conv2d(512, 1024, kernel_size=3, padding=1)
您好,我在看完论文后,感觉您写的代码和论文中cpm那张图有点不一样,想请问一下是我理解的不到位,还是这部分代码并没有根据论文进行编写。十分感谢!!
I met an error.
Traceback (most recent call last):
File "demo.py", line 111, in
detect(net, path, args.thresh)
File "demo.py", line 70, in detect
y = net(x)
File "/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'x'
how do I fix it?
Trying to run wider_test.py on validation part:
python wider_test.py --model ../weights/pyramidbox_5000.pth
but getting an error (on 0004th image?):
Detect 0001 th image costs 4.4119
Detect 0002 th image costs 2.4946
Detect 0003 th image costs 3.0682
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1518244421288/work/torch/lib/THC/generic/THCStorage.cu line=58 error=2 : out of memory
Traceback (most recent call last):
File "wider_test.py", line 238, in <module>
det0 = detect_face(net, img, shrink)
File "wider_test.py", line 61, in detect_face
y = net(x)
File "/root/miniconda3/envs/pytorch0.3.1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "../pyramidbox.py", line 153, in forward
ssh_conv3_norm = self.cpm[0](self.L2Norm3_3(lfpn0_on_conv3))
File "/root/miniconda3/envs/pytorch0.3.1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "../pyramidbox.py", line 57, in forward
out_residual = self.branch1(x)
File "/root/miniconda3/envs/pytorch0.3.1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "../pyramidbox.py", line 36, in forward
return self.bn1(x)
File "/root/miniconda3/envs/pytorch0.3.1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/root/miniconda3/envs/pytorch0.3.1/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 37, in forward
self.training, self.momentum, self.eps)
File "/root/miniconda3/envs/pytorch0.3.1/lib/python3.6/site-packages/torch/nn/functional.py", line 1013, in batch_norm
return f(input, weight, bias)
RuntimeError: cuda runtime error (2) : out of memory at /opt/conda/conda-bld/pytorch_1518244421288/work/torch/lib/THC/generic/THCStorage.cu:58
My pytorch=0.3.1
I'm using GeForce GTX 1080 Ti (11178Mb).
@yxlijun you also work with 11Gb Titan1080. Can you help to manage this memory problem?
@yxlijun HI
看了您的code,受益匪浅
起初看paper时,因为公式较多,很多地方难以理解.结合您的code来看,很多都理解了.非常感谢!
整体感觉:
从code来看,对于损失函数这里,其实还是常规的.重点在于head标签信息的设置,其本质上是通过face的标签信息得到的:
在正负样本匹配时:
从code来看,不论是face还是head,共用一组anchor(priors).
比如一个face,尺度128.那么这个face对应的合理的anchor就会出现在第4个预测分支上.这个face对应head的尺度就是256,那么这个head对应的合理的anchor就会出现在第5个预测分支上.
有个疑问:因为head是由这个face衍生来的,那么需不需要把这个2个anchor标记一下,表示其来自于同一个face呢??从**公式(1),(4)**来看,face和head的anchor总感觉有一种匹配关系.但是从code来看,没有这样的标记,针对face和head的损失都是独立进行的.
另外有另一个版本的PyramidBox复现代码,他针对face和head设计了2组anchors.但总感觉head_anchors设计的有问题.不知道您参考过没?
when i run demo.py,it will happen a mistake which cuda out of memory,but my computer is 2080ti,i don't know how to solve it,Do you have such a mistake?
Hi everyone,
Can anyone provide a download link for pretrained model (vgg16_reducedfc) other than pan.baidu link preferably Google Drive. I have been struggling to download the pth file and I would really appreciate the help. Thanks
请问在哪里设置max_im_shrink
您好,谢谢您提供的代码!我在测试时遇到问题。detect到第1241张图片后traceback,在调用wider_test.py下的bbox_vote函数时,没有进入while循环(报错:UnboundLocalError:local variable 'dets' referenced before assignment),您可以对我的遇到的错误给一些意见吗?谢谢!
Excuse me
I get errors when I run the demo.py ,I can't find the module detection.
the erro: ModuleNotFoundError: No module named 'detection' from detection import Detect
I also want to ask a question whether you used the body to train the module.
and if you can speak chinese ,you can return in chinese to me . thanks.
首先很感谢你提供的项目,很出色的工作。我按照步骤修改了一些小bug,跑通了代码并取得了十分接近原论文的结果。由于论文中许多地方没有给出细节,我在学习代码的过程中有一些看不懂的地方,不知是否能给予初学者一些帮助。
1 prior_box.py文件里 forward函数
这里 s_kw = self.min_sizes[k] / self.imw ,用anchor_size / image_size 有什么意思?
2 pyramidbox.py文件里 multibox函数,
为啥第0层的confidence是8个通道的,而别的层都是6通道?
3 augmentations.py文件里preprocess函数
这里else 后面的操作是干啥意思,算法思路是啥啊,augmentations.py也没有注释,简直要把我看晕了……能否讲一下主要**
4 您给出的代码和原论文给出的代码都是用的SSD_loss, 请问论文里3.4节 PyramidBox loss.那一段里给出的几个公式,
在代码中有体现吗?我没有找到相关的代码
再次感谢你的帮助和不吝赐教!!这对像我一样的小白帮助很大!
只有将max_im_shrink设为1的时候才不会溢出,1080Ti的环境,感觉是什么东西一下子占了很多显存,虽然只allocate不到2G,但free的显存很少。
您好:现在用您的代码跑了个基本结果,fddb数据集基本对上,在测试wideerface时总是out of memory,我的显卡为k80,请问您的显卡显存时多大?谢谢。
File ".\demo.py", line 74, in detect
y = net(x)
File "C:\Users\xxxxx\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "C:\Users\xxxxx\Desktop\local\Pyramidbox.pytorch\pyramidbox.py", line 252, in forward
priors)
File "C:\Users\xxxxx\Desktop\local\Pyramidbox.pytorch\layers\functions\detection.py", line 65, in forward
boxes_, scores, self.nms_thresh, self.top_k)
ValueError: not enough values to unpack (expected 2, got 0)
PS C:\Users\shuxin\Desktop\local\Pyramidbox.pytorch>
运行train.py时。报错提示
RuntimeError: cuda runtime error (2) : out of memory at /pytorch/torch/lib/THC/generic/THCStorage.cu:58
使用的训练显卡是 TITAN XP 12196Mb
请问如何解决
您好,非常感谢您的代码,我现在使用的是pytorch1.0稳定版,我按照您的设置进行训练时,尝试了不同的学习率,发现1e-3就可以开始收敛,您问什么把学习率设置那么小,是pytorch版本问题,还是什么trick。
在文件tools/wider_test.py中,函数bbox_vote中
if
merge_index.shape[0] <= 1:
continue
不是应该
if merge_index.shape[0] < 1: continue
吗?
Thanks a lot yxlijun.
Your work has helped me a lot with my project.
I tried to download trained model for running demo.py
But it seems I can't get to baidu drive.
Uploading to ex)google drive will be very helpful.
I am currently working on implementation of pyramidbox using pre trained model in google colab, I have tried to follow all the instruction mentioned in the repo for the same. While implementing the command(python tools/wider_test.py) I am getting the following error:
Traceback (most recent call last):
File "tools/wider_test.py", line 22, in
from data.config import cfg
ModuleNotFoundError: No module named 'data'
Please help me out!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.