Skip to content

Instantly share code, notes, and snippets.

@ck196
Created March 8, 2016 00:57
Show Gist options
  • Save ck196/f4ad299898ac719ce07b to your computer and use it in GitHub Desktop.
Save ck196/f4ad299898ac719ce07b to your computer and use it in GitHub Desktop.
img = read_image(file_name)
x_batch = np.ndarray((1, 3, model.insize, model.insize), dtype=np.float32)
x_batch[0] = img
y_batch = np.ndarray((1,), dtype=np.int32)
y_batch[0] = label
x = chainer.Variable(xp.asarray(x_batch), volatile=True)
t = chainer.Variable(xp.asarray(y_batch), volatile=True)
all_prob = model(x,t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment