Colaboratory and Fastai

I can run Lesson #1 on Crestle with no problem but when I run the same notebook on Google Colab after installing the relevant libraries and downloading the relevant data I get this error message. As a temporary workaround I made the following revision and now the script runs until the end:

log_preds,y = learn.TTA()
probs = np.mean(np.exp(log_preds),0)
#begin extra code
probs = log_preds
def accuracy_np(preds, targs):
preds = np.argmax(preds, 1)
return (preds==targs).mean()
#end extra code
accuracy_np(probs, y)

My question is if anybody here happens to have a version of Lesson #1 that is able to run in full on Google Colab at the time of this posting? Did you have to make a similar modification to the code? If so, I would appreciate if you could share your entire .ipynb file so that I can compare my solution (see github link) to yours.

Thanks,
Paul

3 Likes