-
Notifications
You must be signed in to change notification settings - Fork 266
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
Any ideas on: InvalidArgumentError: Assign requires shapes of both tensors to match. #27
Comments
That error normally means that your the current model is different from the pre-trained model. Double check to make sure that the shapes of all your variables are the same as the graph you saved, same number of LSTM units, etc. |
Ah, you're totally right! I was so worried that the conversion from Py2 to 3 had messed something up I didn't check the more obvious answer, which you've already patiently answered before. Thanks for your help. Now I just need to figure out why some of my questions (like "hi") cause the below. Something for the weekend!
|
My gut feeling there is that all of the responses/words outputted from the model are empty strings, and thus in line 33 in model.py, listOfResponses will be an empty list and thus, you'll get an index out of range error. You might wanna put some sort of if statement there to check whether the list is empty, and then output something else instead. |
In the currently live app.py, the code has line 18: Changing both to 112 fixed this issue for me! |
Thanks, changed the line in app.py to reflect that. |
Have gone through this great tutorial (thank you for it!) but am hitting an issue I haven't seen.
On Gunicorn/Flask running on my Heroku server, I get an error saying my tensor shapes don't match:
lhs shape= [52293,48] rhs shape= [52293,112]
Not sure what to do with this, as I trained them using the code as expected in the tutorial.
Do you think this is a training error or a Flask implementation issue? I did update the Py2 code to run on Py3, may have introduced an error. But that was mainly adding parenthesis and cleaning up tabs/spacing - I'm not sure why that would cause different tensor shapes?
Any suggestions would be greatly appreciated.
Log dump below.
The text was updated successfully, but these errors were encountered: