Remove Tensor.data (#565)

This commit is contained in:
Kirill
2023-02-19 03:36:12 +03:00
committed by GitHub
parent 4efe0169bb
commit 7944cfdadc
17 changed files with 65 additions and 69 deletions

View File

@@ -46,7 +46,7 @@ def _infer(model: EfficientNet, img, bs=1):
# run the net
if bs > 1: img = img.repeat(bs, axis=0)
out = model.forward(Tensor(img)).cpu()
return _LABELS[np.argmax(out.data[0])]
return _LABELS[np.argmax(out.numpy()[0])]
chicken_img = Image.open(pathlib.Path(__file__).parent / 'efficientnet/Chicken.jpg')
car_img = Image.open(pathlib.Path(__file__).parent / 'efficientnet/car.jpg')