Code Monkey home page Code Monkey logo

pyramidbox.pytorch's People

Contributors

guoxiawang avatar yxlijun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyramidbox.pytorch's Issues

wrong conv6

在你的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模块的

您好,我在看完论文后,感觉您写的代码和论文中cpm那张图有点不一样,想请问一下是我理解的不到位,还是这部分代码并没有根据论文进行编写。十分感谢!!

forward() missing 1 required positional argument: 'x'

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?

out of memory when running wider_test.py

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?

about implementation

@yxlijun HI
看了您的code,受益匪浅
起初看paper时,因为公式较多,很多地方难以理解.结合您的code来看,很多都理解了.非常感谢!

整体感觉:
从code来看,对于损失函数这里,其实还是常规的.重点在于head标签信息的设置,其本质上是通过face的标签信息得到的:

  1. 关于head坐标信息,体现在data/widerface.py中,head的坐标就是在face的基础上扩大了一倍.这个感觉就对应的是**公式(5)**的内容
  2. 关于head类别标签(0/1)信息,和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设计的有问题.不知道您参考过没?

demo.py cuda out of memory

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?

Pretrained model download link

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

运行wider_test.py遇到的问题

您好,谢谢您提供的代码!我在测试时遇到问题。detect到第1241张图片后traceback,在调用wider_test.py下的bbox_vote函数时,没有进入while循环(报错:UnboundLocalError:local variable 'dets' referenced before assignment),您可以对我的遇到的错误给一些意见吗?谢谢!

about demo

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函数
1
这里 s_kw = self.min_sizes[k] / self.imw ,用anchor_size / image_size 有什么意思?

2 pyramidbox.py文件里 multibox函数,
image
为啥第0层的confidence是8个通道的,而别的层都是6通道?

3 augmentations.py文件里preprocess函数
image
这里else 后面的操作是干啥意思,算法思路是啥啊,augmentations.py也没有注释,简直要把我看晕了……能否讲一下主要**

4 您给出的代码和原论文给出的代码都是用的SSD_loss, 请问论文里3.4节 PyramidBox loss.那一段里给出的几个公式,
image
image
在代码中有体现吗?我没有找到相关的代码

再次感谢你的帮助和不吝赐教!!这对像我一样的小白帮助很大!

CUDA OUT OF MEMORY

只有将max_im_shrink设为1的时候才不会溢出,1080Ti的环境,感觉是什么东西一下子占了很多显存,虽然只allocate不到2G,但free的显存很少。

关于测试widerface问题

您好:现在用您的代码跑了个基本结果,fddb数据集基本对上,在测试wideerface时总是out of memory,我的显卡为k80,请问您的显卡显存时多大?谢谢。

i use one common image without face to test, but one bug occurs? expect to explain it?

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>

out of memory when run train.py

运行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。

关于训练模型

您好!请问您提供的pyramidbox.pth是通过您给的代码训练出来的吗?我用您的代码训练了模型,在测试的时候每张图片得到的结果都是如下图左所示(最后的图是用您提供的模型测试出的)。我是否是在训练的某一步骤出了错呢?谢谢!
IMG_2904(2)
IMG_2905

关于合并bbox问题

在文件tools/wider_test.py中,函数bbox_vote中
if merge_index.shape[0] <= 1:
continue
不是应该if merge_index.shape[0] < 1: continue
吗?

Another link for trained model

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.

Regarding implementation of this repo in google colaboratory

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!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.