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

Plot loss Curve error #1025

Open
Valen-Nneji-007 opened this issue Jul 28, 2024 · 4 comments
Open

Plot loss Curve error #1025

Valen-Nneji-007 opened this issue Jul 28, 2024 · 4 comments

Comments

@Valen-Nneji-007
Copy link

After writing the code from video 159, plotting the loss curve of model 0, I got a disturbing error, that I don't understand..
Loss curve error

@pritesh2000
Copy link
Contributor

It is one of the error, which were introduced in beginning shape error.
Here you must have same shape for first dimension, however in your case there is different shape of x and y. This might occur when you are declaring x or y.

Image is not having enough data, You should provide model_0_results and plot_loss_curves function (if you made it) for better understanding to proble.

@Valen-Nneji-007
Copy link
Author

model_0_results
plot loss curve

@pritesh2000
Copy link
Contributor

pritesh2000 commented Aug 9, 2024

In here I don't see any problems. So if you want to troubleshoot see the result of model_0_results and make sure that train_loss and test_loss have same length, also same for train_acc and test_acc.

If this doesn't resolve issue, then put print statement in each block of function plot_loss_curves like,

plt.figure(figsize=(15, 7))
print("plt.figure is working")
plt.plot(epochs, accuracy, label= "train_accuracy")
print("plt.plot train_accuracy is working")

This will give you an idea of what is causing this error.

In your code you put label= "train_accuracy" in both accuracy and test_accuracy this isn't causing any error but still change it for better understanding.

If this error still bothers you, ask me again.

@pritesh2000
Copy link
Contributor

hey, Does this work or not ?

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