Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@Hank538, The following code works fine for me.

import cv2 as cv
import numpy as np

np.random.seed(2701)

net = cv.dnn.readNet('frozen.pb')
inp = np.random.standard_normal([1, 784]).astype(np.float32)

net.setInput(inp)
out = net.forward()
print out

Output:

[[  1.33815183e-06   5.64191076e-08   3.70280895e-06   7.99171573e-08
    6.58905017e-04   2.29165620e-09   8.71605792e-08   8.88653449e-04
    1.90605744e-04   9.98256624e-01]]

@Hank538, The following code works fine for me.me (a master branch).

import cv2 as cv
import numpy as np

np.random.seed(2701)

net = cv.dnn.readNet('frozen.pb')
inp = np.random.standard_normal([1, 784]).astype(np.float32)

net.setInput(inp)
out = net.forward()
print out

Output:

[[  1.33815183e-06   5.64191076e-08   3.70280895e-06   7.99171573e-08
    6.58905017e-04   2.29165620e-09   8.71605792e-08   8.88653449e-04
    1.90605744e-04   9.98256624e-01]]