fastai / course-v3

The 3rd edition of course.fast.ai
https://course.fast.ai/
Apache License 2.0
4.91k stars 3.57k forks source link

add .detach to fix .numpy() issue #521

Closed yannklein closed 4 years ago

yannklein commented 4 years ago

While running plt.scatter(x[:,0],x@a)

I had the following issue: RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead.

After some googling, I found this solution.

Thus, I propose the following fix to smoothen the Lesson SGD :) Fix: plt.scatter(x[:,0],x@a.detach())

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

Review Jupyter notebook visual diffs & provide feedback on notebooks.


Powered by ReviewNB