Lesson1.ipynb - Error - TypeError: torch.max received an invalid combination of arguments - got (numpy.ndarray, dim=int)

just encountered this.
collating what worked for me.

update fastai/metrics.py to this version
https://raw.githubusercontent.com/fastai/fastai/master/fastai/metrics.py

def accuracy_np(preds, targs):
preds = np.argmax(preds, 1)
return (preds==targs).mean()

#then in the workbook, after
log_preds, y = learn.TTA()

probs = np.mean(np.exp(log_preds),0)
print (“accuracy_np(probs, y):”, accuracy_np(probs, y))
print (“metrics.log_loss(y, probs):”, metrics.log_loss(y, probs))

many thanks to pandeyaah for putting us on track.

note to self: keep up to date with Jeremies’ git updates :slight_smile:

2 Likes

Thanks a lot worked like a charm :wink:

Woooooooorks!
Thank you.

This now has been fixed in the github repo: