-
Notifications
You must be signed in to change notification settings - Fork 74k
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
ValueError: No gradients provided for any variable (Keras 2.4, Tensorflow 2.3.0) #42038
Comments
@ScruffySilky, Could you please provide all the necessary files required to run the script. Thanks! |
Sure, here are the locations of the two files needed to run it: |
I'm 100% sure it has to do with my data_generator because running the belolw example works fine It just cant fit the data into memory https://github.com/ekohendratno/Screenshot-to-code-in-Keras/blob/master/floydhub/Bootstrap/bootstrap.ipynb |
@ScruffySilky, |
The error occurs on the model.fit.generator() function:
|
Having the same issue. Using model.fit with just numpy arrays works (with saved data using EDIT: |
Any suggestion for my code? |
Try changing the yield part in
to just:
Since the documentation expects a tuple |
Changing that gives this error:
|
@ScruffySilky, |
|
Was able to reproduce the issue with TF v2.3. Please find the gist of it here. Thanks! |
So you guys upgrade your back-end and I as a paying customer must just forget my project because it doesn't work on your new platform. Is there any resolution to this... |
Is there any planned solution for this bug ? |
I had same problem @ScruffySilky but i resolved it. The problem is in data generator function, because model.fit(generator,....) expect a list of tuple or a dict of tuple. To resolve this u must modify the data generator function as: yield ([array(Ximages), array(XSeq)], array(y)) instead of yield [[array(Ximages), array(XSeq)], array(y)] |
I hope this resolves ur issue. |
Ok I cannot train on TPU, but I am able to train on GPU. "To resolve this u must modify the data generator function as: yield ([array(Ximages), array(XSeq)], array(y)) instead of yield [[array(Ximages), array(XSeq)], array(y)]" |
Im still getting the error
10 frames InvalidArgumentError: 2 root error(s) found. Function call stack: Please help |
@kartiksonaghela, |
So I'm using this model to train on Google colab, it was written for Tensorflow 1.9 and Keras 2, but when I train I get the following error, has anyone seen this or how to solve it?
It was training fine before but this error started today.
Actual code:
Error I receive when training:
I'm training it on Google Colab using the TPU. If I train it on Tensorflow 1.x it trains fine but takes 8 hours per epoch with my dataset. Tensorflow 2.x was taking 1 hour per epoch but is now giving this error
EDIT: SOLUTION
I cannot train on TPU, but I am at least able to train on GPU, I can continue the project !
Solution by @silentkinght25 and @silentkinght25 solves it.
"To resolve this u must modify the data generator function as: yield ([array(Ximages), array(XSeq)], array(y)) instead of yield [[array(Ximages), array(XSeq)], array(y)]"
The text was updated successfully, but these errors were encountered: