×

签到

分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

faster rnn在docker镜像中量化问题 已解决 lxjin2002021-08-13 20:07:25 回复 9 查看 使用求助
faster rnn在docker镜像中量化问题
分享到:

为了测试模型量化的功能,我们尝试着量化faster_rcnn模型。

模型采用的是pytorch官方的fasterrcnn_resnet50_fpn()模型,其中为了测试我们将num_classes参数赋值为1。

docker镜像里的pytorch 版本为1.3.0,torchision版本为0.2.1。

在按照官方手册量化模型的步骤,进行到在CPU上进行推理,生成量化值的时候,即调用quantized_model(input_tensor)的时候,报错如下:

…………

>>> input_tensor.shape           

torch.Size([3, 3, 640, 480])

>>> quantized_model(input_tensor)

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

[warning] It seems that evaluation reaches maxium img_num or iteration is in network. Quantization still works.

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/torch/venv3/pytorch/lib/python3.5/site-packages/torch/nn/modules/module.py", line 541, in __call__

    result = self.forward(*input, **kwargs)

  File "/torch/venv3/pytorch/lib/python3.5/site-packages/torchvision/models/detection/generalized_rcnn.py", line 71, in forward

    proposals,proposal_losses = self.rpn(image_sizes, features, self.Anchors, targets)

  File "/torch/venv3/pytorch/lib/python3.5/site-packages/torch/nn/modules/module.py", line 541, in __call__

    result = self.forward(*input, **kwargs)

  File "/torch/venv3/pytorch/lib/python3.5/site-packages/torchvision/models/detection/rpn.py", line 471, in forward

    proposals = self.box_coder.decode(pred_bbox_deltas.detach(), anchors)

  File "/torch/venv3/pytorch/lib/python3.5/site-packages/torchvision/models/detection/_utils.py", line 168, in decode

    rel_codes.reshape(sum(boxes_per_image), -1), concat_boxes

RuntimeError: shape '[159882, -1]' is invalid for input of size 920880



我们尝试着在量化前执行推理,依然遇到了相同的错误!


在我们的本地环境执行推理就没有这个错误!请问这是什么情况


版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭