Skip to content

The output is different with the same input on CUDA #4014

@freedenS

Description

@freedenS

Describe the bug
I trained a MaskRcnn model and convert it to onnx. When i use test images to do inference,it can give the correct output. But if i do the inference with a white image (all 255) first, and then use test images to do inference, it can't recognize correctly with onnxruntime-gpu1.3.0.
if i use onnxruntime1.3.0, it will not happen.

System information

  • OS Platform and Distribution :Windows 10 (c++) & Linux Ubuntu 16.04(python3.7)
  • ONNX Runtime installed from :binary from pip install
  • ONNX Runtime version:1.3.0
  • Python version:3.7
  • Visual Studio version (if applicable):2017
  • GCC/Compiler version (if compiling from source):compiling from binary
  • CUDA/cuDNN version:CUDA10.1 & cuDNN7.6.5
  • GPU model and memory:2080Ti 11G

To Reproduce

import os
import onnxruntime
import cv2
import torch #1.5.0
from detectron2.data.transforms as T #just for resize
filelist = os.listdir('./')
sess = onnxruntime.InferenceSession('./segmentation.onnx')
for i in filelist:
    inputs = cv2.imread('./' + i)
    transform_gen = T.ResizeShortestEdge([800,800],1333)
    inputs = transform_gen.get_transform(inputs).apply_image(inputs)
    inputs = torch.as_tensor(inputs.astype('float32').transpose(2,0,1))
    inputs = inputs.unsqueeze(0)
    res = sess.run(None, {sess.get_inputs()[0].name:inputs.numpy()})
    print (res)

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot from 2020-05-21 16-50-27

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions