Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative values when making inference on notebook PytorchTensorflowMnist.ipynb #262

Open
handreyeg opened this issue Jan 4, 2022 · 0 comments
Labels

Comments

@handreyeg
Copy link

I'm using the PytorchTensorflowMnist.ipynb notebook available here.

When I run the code below, the prediction is right (the number in the image is 2), but shouldn't the output variable be the precision value? If it's the precision value, why is it negative? Or what output variable represents and how can I get the precision value?

img = Image.open('assets/two.png').resize((28, 28)).convert('L') 
display(img)
output = tf_rep.run(np.asarray(img, dtype=np.float32)[np.newaxis, np.newaxis, :, :])
print('The digit is classified as ', np.argmax(output))
print(output._0)

The output of the code above is

The digit is classified as 2
[[-697.756   -923.469   0.   -448.76907   -864.5122   -835.3161   -455.5511   -717.3065   -596.7475   -544.3611 ]]

Any help would be appreciated, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant