The issue is that lesson1-vgg.ipynb
(https://github.com/fastai/fastai/blob/master/courses/dl1/lesson1-vgg.ipynb) cannot be completed. I cannot run the last line, accuracy(log_preds,y)
, as it fails saying:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-18-826ab674d3ed> in <module>()
1 log_preds,y = learn.TTA()
----> 2 accuracy(log_preds,y)
/media/user/drive/git_fastai/fastai/courses/dl1/fastai/metrics.py in accuracy(preds, targs)
7
8 def accuracy(preds, targs):
----> 9 preds = torch.max(preds, dim=1)[1]
10 return (preds==targs).float().mean()
11
TypeError: torch.max received an invalid combination of arguments - got (numpy.ndarray, dim=int), but expected one of:
* (torch.FloatTensor source)
* (torch.FloatTensor source, torch.FloatTensor other)
didn't match because some of the keywords were incorrect: dim
* (torch.FloatTensor source, int dim)
* (torch.FloatTensor source, int dim, bool keepdim)
I have an updated version of fastai from git, running on an up-to-date Ubuntu desktop, with a git pull
and conda env update
as of today. I had previously last updated a couple of weeks ago, and tried updating today only because this wouldn’t work. Unfortunately, updating did not resolve the issue, which is why I am posting this.
(On a side note, for my understanding only, why does vgg16 take almost 4 gb of the gpu? running the regular lesson 1 doesn’t seem to need so much. ??)