AttributeError 'float object has no attribute 'cpu' - first model

Followed all the setup steps, including using the fastai template in paperspace. Everything fine until I try to use the first model “Our first model: quick start”. I get: AttributeError: 'float object has no attribute ‘cpu’

No idea why this might be. I’m relatively new to python and ML. Can someone point me in the right direction?


Same occurred with my first attempt at running lesson1.pynb on Windows 10 with the (base) Anaconda3 and (fastai) environments installed and (fastai) activated.

Here’s what fixed it for me —> remembering the fastai Lesson 1 video suggestion to occasionally run the following commands from, in my case, the Win 10 Command window:

 git pull

 conda env update

Works now … Intel 8700 CPU & NVIDIA GeForce 1080Ti GPU ran these two Epochs with 99% accuracy in 6 seconds:

Thank you. Had the same error. I did a git pull in fastai/fastai/ directory and the code now works. A fix for this error was checked in yesterday in

1 Like