Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

faster_rcnn predictions not consistent #680

Open
shortcipher3 opened this issue Jul 26, 2018 · 6 comments
Open

faster_rcnn predictions not consistent #680

shortcipher3 opened this issue Jul 26, 2018 · 6 comments
Assignees

Comments

@shortcipher3
Copy link

Repeated predictions give different results, I modified the example demo.py by replacing:

    img = utils.read_image(args.image, color=True)
    bboxes, labels, scores = model.predict([img])
    bbox, label, score = bboxes[0], labels[0], scores[0]

with

    img = utils.read_image(args.image, color=True)
    bboxes, labels, scores = model.predict([img])
    bbox, label, score = bboxes[0], labels[0], scores[0]
    print(label)
    print(score)

    img = utils.read_image(args.image, color=True)
    bboxes, labels, scores = model.predict([img])
    bbox, label, score = bboxes[0], labels[0], scores[0]
    print(label)
    print(score)

Running on an image prints two different results.
[ 6 9 11 12 14 14 14]
[0.9994035 0.7133383 0.9320137 0.9976526 0.9986652 0.98459226
0.7558696 ]
[ 6 11 12 14 14]
[0.99914455 0.81991583 0.96614665 0.9929738 0.9864108 ]

Any idea as to why that would be?

@yuyu2172
Copy link
Member

Hmm. I tried to reproduce your problem, but the model outputs the same consistently with images I have.
Is it possible to have your image?

@Hakuyume
Copy link
Member

Some operations of cuDNN do not have deterministic behaviour.
https://docs.nvidia.com/deeplearning/sdk/cudnn-developer-guide/#reproducibility
Perhaps, this is related to your problem.

@shortcipher3
Copy link
Author

Hmm.

I'm using the projects reference image: https://cloud.githubusercontent.com/assets/2062128/26187667/9cb236da-3bd5-11e7-8bcf-7dbd4302e2dc.jpg

@Hakuyume
I'm not using cuDNN, I'm using a CPU based model.

I dockerized my setup and also uploaded the modified demo.py. Had to change extensions to upload, should be demo-mod.py,

Dockerfile.txt
demo-mod.txt

Are you running on a GPU @yuyu2172 ?

Thanks for your help!

@yuyu2172
Copy link
Member

I tested on GPU/CPU on my machine. I ran your script, and I get consistent results.
I am building the docker container now.

$ python demo-mod.py  9cb236da-3bd5-11e7-8bcf-7dbd4302e2dc.jpg  
[ 6 11 12 14 14]
[0.99953234 0.9766117  0.997649   0.9980629  0.99296147]
[ 6 11 12 14 14]
[0.99953234 0.9766117  0.997649   0.9980629  0.99296147]
[ 6 11 12 14 14]
[0.99953234 0.9766117  0.997649   0.9980629  0.99296147]

@shortcipher3
Copy link
Author

My results are looking more consistent today:

[ 6 11 12 14 14]
[0.9991875  0.96595764 0.99568295 0.99677104 0.9895921 ]
[ 6 11 12 14 14]
[0.9994771 0.9520375 0.9942531 0.9980769 0.9920569]
[ 6 11 12 14 14]
[0.9995468  0.9600438  0.99564916 0.99760795 0.9974911 ]

The scores are still slightly different. Thanks for looking into it!

@knorth55
Copy link
Contributor

knorth55 commented Sep 8, 2018

Can i close this issue? @yuyu2172

@knorth55 knorth55 added the bug label Sep 8, 2018
@knorth55 knorth55 added the stall label Nov 6, 2018
@knorth55 knorth55 added this to the 1.0 milestone Dec 4, 2018
@knorth55 knorth55 removed this from the 1.0 milestone Dec 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants