Coder Social home page Coder Social logo

pyramidbox_pytorch's Issues

运行demo.py时出错

你好,我成功的训练出了模型。但是在运行demo.py的时候出现了一个bug。

Traceback (most recent call last):
File "demo.py", line 117, in
detect(net, path, args.thresh)
File "demo.py", line 73, in detect
y = net(x)
File "/home/huyutao/anaconda3/envs/pytorch_gpu/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/huyutao/anaconda3/envs/pytorch_gpu/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/huyutao/anaconda3/envs/pytorch_gpu/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/huyutao/face_mask_detect/pyramidbox_pytorch/models/pyramidbox.py", line 262, in forward
self.softmax(face_mbox_conf))
TypeError: forward() missing 1 required positional argument: 'prior_data'

我查看了下源代码,是在pyramidbox.py中的261行。output = self.detect(face_mbox_loc, self.softmax(face_mbox_conf))少传了一个参数
Detect class貌似需要3个参数:loc_data, conf_data, prior_data;
请问下,prior_data这个参数如何传递?

如果我的理解有误,也请告知解决这个bug的方法。。。谢谢。

bug in demo.py

the flowing code is in your 'models.pyramidbox.py':

if not self.is_infer:
    output = (face_mbox_loc, face_mbox_conf,
                      head_mbox_loc, head_mbox_conf)
 else:
    output = self.detect(face_mbox_loc, self.softmax(face_mbox_conf))

but the function self.detect() needs three parameters in your script 'layers.functions.detection.py'

class Detect(Function):
    def __init__(self, cfg):
          ...
    def forward(self, loc_data, conf_data, prior_data):

so, when i run 'demo.py', the flowing error reported:

TypeError: forward() missing 1 required positional argument: 'prior_data'

bug in demo.py

from pyramidbox import build_net
to
from models.pyramidbox import build_net

您好,我运行demo.py的时候,显示如下,网上说batchsize太大,但是我找到不到运行demo.py调整batchsize的地方?

/home/lyl/anaconda3/envs/py1.3/bin/python /home/lyl/000_Code/pyramidbox_1.3/demo.py
Traceback (most recent call last):
File "/home/lyl/000_Code/pyramidbox_1.3/demo.py", line 113, in
detect(net, path, args.thresh)
File "/home/lyl/000_Code/pyramidbox_1.3/demo.py", line 73, in detect
y = net(x)
File "/home/lyl/anaconda3/envs/py1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/lyl/000_Code/pyramidbox_1.3/models/pyramidbox.py", line 173, in forward
ssh_conv3_norm = self.cpm0
File "/home/lyl/anaconda3/envs/py1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/lyl/000_Code/pyramidbox_1.3/models/pyramidbox.py", line 56, in forward
out_residual = self.branch1(x)
File "/home/lyl/anaconda3/envs/py1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/lyl/000_Code/pyramidbox_1.3/models/pyramidbox.py", line 35, in forward
return self.bn1(x)
File "/home/lyl/anaconda3/envs/py1.3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/lyl/anaconda3/envs/py1.3/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 81, in forward
exponential_average_factor, self.eps)
File "/home/lyl/anaconda3/envs/py1.3/lib/python3.6/site-packages/torch/nn/functional.py", line 1670, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: CUDA out of memory. Tried to allocate 322.00 MiB (GPU 0; 3.95 GiB total capacity; 2.90 GiB already allocated; 88.56 MiB free; 39.48 MiB cached)

Process finished with exit code 1

bug in train.py

criterion1(out, face_targets)
but criterion1 = MultiBoxLoss(cfg, args.cuda)
def forward(self, predictions, priors, targets):
"""Multibox Loss
need 3 args
TypeError: forward() missing 1 required positional argument: 'targets'

Problems in training

Hello, I have the following error when running the train.py file:
runtimeerror: expected a 'CUDA' device type for generator but found 'CPU'
How can I solve this problem?

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.