Skip to content

Commit

Permalink
fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Isotr0py committed Oct 8, 2023
1 parent 70fe7e1 commit b8b8402
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions finetune/tag_images_by_wd14_tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main(args):
)
args.batch_size = batch_size
ort_sess = ort.InferenceSession(
model.SerializeToString(),
onnx_path,
providers=["CUDAExecutionProvider"]
if "CUDAExecutionProvider" in ort.get_available_providers()
else ["CPUExecutionProvider"],
Expand Down Expand Up @@ -154,7 +154,7 @@ def run_batch(path_imgs):
imgs = np.array([im for _, im in path_imgs])

if args.onnx:
probs = ort_sess.run(None, {input_name: imgs}) # onnx output numpy
probs = ort_sess.run(None, {input_name: imgs})[0] # onnx output numpy
else:
probs = model(imgs, training=False)
probs = probs.numpy()
Expand Down

0 comments on commit b8b8402

Please sign in to comment.