Getting an error in ' Neural Network SMS Text Classifier'

ImportError: cannot import name '__version__' from 'keras' (/usr/local/lib/python3.7/dist-packages/keras/__init__.py)

Code: Google Colaboratory

Challenge: https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/neural-network-sms-text-classifier

Any help would be really appreciated! Thanks!

Hello, @Drishith. Tensorflow is not my strength but I’ll try to help.
The source of download seems problematic, I made a small research of past cases and there is not too much info.
In any case You can try installing tf-nightly-estimator.

pip install tf-estimator-nightly

Remember, there is no need of an specific estimator to the predictions in your work.
Hope this helps.

That is no longer an issue now. I got it when trying to solve this issue:
ImportError: cannot import name '__version__' from 'keras' (/usr/local/lib/python3.7/dist-packages/keras/__init__.py)

I have come back to the beginning and need really need some help in solving this one…
Thank You!

If I click on the link, I get an error from google, saying that I don’t have the rights to access your collab.

Extremely sorry for the inconvenience caused. I have changed the link now. :slight_smile:

hm… There is a chance you might need to manually use a different version of Tensorflow - though I really can’t tell you much more. Did a quick google search and people seem to have been running in similar issues, but I couldn’t find something exactly relating to this scenario.
The file-path does contain a version, so no idea what it means it cannot find it.
Alternativly, you could try working without tensorflow_hub. I don’t know what it is doing, so all I can say is, you can solve the challenge without it.

As far as what I know, I think the error is with keras (Hope I’m right!). The thing is I don’t think I know how to solve it without keras :sweat_smile:. So, is there any compatible version of keras that I can use along with a specific version of tensorflow. If so, can you please let me know about the versions? Thanks!

Hey All!
I think I have figured it out! Thank You @AndyG and @Jagaya!

So, all I have done is imported tensorflow instead of tensorflow nightly!
Sorry that I have wasted all of your time!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.