andy-wyx commited on
Commit
e97c0ff
1 Parent(s): a8b0c52

update getting logits

Browse files
Files changed (1) hide show
  1. inference_resnet_v2.py +2 -1
inference_resnet_v2.py CHANGED
@@ -67,8 +67,9 @@ def inference_resnet_finer_v2(x,model,size=384,n_classes=142,n_top=10):
67
  # predictions = tf.math.top_k(batch_logits, k=10)
68
  # print(predictions)
69
  logits = model.predict(np.array([x]))
 
70
  print(logits)
71
- logits = tf.nn.softmax(logits[0][0]).cpu().numpy()
72
  print(logits)
73
  top_n = select_top_n(logits,n=n_top)
74
  print(top_n)
 
67
  # predictions = tf.math.top_k(batch_logits, k=10)
68
  # print(predictions)
69
  logits = model.predict(np.array([x]))
70
+ print(len(logits[0][0]))
71
  print(logits)
72
+ logits = tf.nn.softmax(logits[1][0]).cpu().numpy()
73
  print(logits)
74
  top_n = select_top_n(logits,n=n_top)
75
  print(top_n)