首页 Paddle框架 帖子详情
在ubuntu上部署PaddleDetection验证无法通过
收藏
快速回复
Paddle框架 问答学习资料 1177 2
在ubuntu上部署PaddleDetection验证无法通过
收藏
快速回复
Paddle框架 问答学习资料 1177 2
  • 【问题描述】:

当前ubuntu上安装了 paddlepaddle 2.3.0paddledet 2.4.0。然后在运行测试代码时出现问题。

python ppdet/modeling/tests/test_architectures.py

W0625 13:03:12.700165 17438 gpu_context.cc:278] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.7, Runtime API Version: 10.2
W0625 13:03:12.702124 17438 gpu_context.cc:306] device: 0, cuDNN Version: 7.6.
....E..
======================================================================
ERROR: test_trainer (__main__.TestPicoDet)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ppdet/modeling/tests/test_architectures.py", line 37, in test_trainer
    trainer = ppdet.engine.Trainer(cfg, mode='test')
  File "/home/nansu/PaddleDetection/ppdet/engine/trainer.py", line 102, in __init__
    self.model = create(cfg.architecture)
  File "/home/nansu/PaddleDetection/ppdet/core/workspace.py", line 246, in create
    cls_kwargs.update(cls.from_config(config, **kwargs))
  File "/home/nansu/PaddleDetection/ppdet/modeling/architectures/picodet.py", line 55, in from_config
    head = create(cfg['head'], **kwargs)
  File "/home/nansu/PaddleDetection/ppdet/core/workspace.py", line 283, in create
    return cls(**cls_kwargs)
  File "/home/nansu/PaddleDetection/ppdet/modeling/heads/pico_head.py", line 471, in __init__
    cell_offset=cell_offset, )
  File "/home/nansu/PaddleDetection/ppdet/modeling/heads/gfl_head.py", line 240, in __init__
    self.distribution_project = Integral(self.reg_max)
  File "/home/nansu/PaddleDetection/ppdet/modeling/heads/gfl_head.py", line 71, in __init__
    paddle.linspace(0, self.reg_max, 1))
  File "/home/nansu/anaconda3/lib/python3.7/site-packages/paddle/fluid/layers/tensor.py", line 1574, in linspace
    dtype)
ValueError: (InvalidArgument) The num of linspace op should be larger than 0, but received num is 0
  [Hint: Expected num > 0, but received num:0 <= 0:0.] (at /paddle/paddle/phi/kernels/gpu/linspace_kernel.cu:70)
  [operator < linspace > error]

----------------------------------------------------------------------
Ran 7 tests in 142.766s

FAILED (errors=1)

下面是定位问题所在的代码:

line  71

    def __init__(self, reg_max=16):
        super(Integral, self).__init__()
        self.reg_max = reg_max
        print('1','\n')
        print(self.reg_max,'\n')
        print('1','\n')
        self.register_buffer('project',
                             paddle.linspace(0, self.reg_max, self.reg_max + 1))

line  1574

    if _in_legacy_dygraph():
        return _C_ops.linspace(tensor_start, tensor_stop, tensor_num, 'dtype',
                               dtype)
  • 【尝试过的方案】:

1、将 

paddle.linspace(0, self.reg_max, self.reg_max + 1)

修改为

paddle.linspace(0, self.reg_max, self.reg_max + 1,‘float32’)

无效

2、通过print将reg_max输出,结果如下:

W0625 13:07:55.061535 18050 gpu_context.cc:306] device: 0, cuDNN Version: 7.6.
..1 

16 

1 

..1 

7 

1 

E..
======================================================================

0
收藏
回复
全部评论(2)
时间顺序
李长安
#2 回复于2022-07

要不?不验证了?直接用一下试试?

0
回复
毒皇后的小魔镜
#3 回复于2022-09

你好,这个问题解决了么?我也遇上了

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户