Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

04.first-neural-network.ipynb error #2

Closed
caxelrud opened this issue Apr 17, 2020 · 1 comment
Closed

04.first-neural-network.ipynb error #2

caxelrud opened this issue Apr 17, 2020 · 1 comment

Comments

@caxelrud
Copy link

I am getting the following error for 04.first-neural-network.ipynb notebook:

--------------------------------------------------
RuntimeError     Traceback (most recent call last)
<ipython-input-28-8756d5fbee9e> in <module>
     10 
     11     if epoch % 100 == 0:
---> 12       train_acc = calculate_accuracy(y_train, y_pred)
     13 
     14       y_test_pred = net(X_test)

<ipython-input-24-51ba3ab94870> in calculate_accuracy(y_true, y_pred)
      1 def calculate_accuracy(y_true, y_pred):
      2   predicted = y_pred.ge(.5).view(-1)
----> 3   return (y_true == predicted).sum().float() / len(y_true)

RuntimeError: Expected object of scalar type Float but got scalar type Byte for argument #2 'other'
@curiousily
Copy link
Owner

curiousily commented Apr 20, 2020

Hey @caxelrud,

Just rerun the notebook on Google Colab and everything seems to execute/train fine. Are you using different model/dataset/environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants