PyCharm cannot import tensorflow.keras

Answered

I am working with the tensorflow-implementation from Keras and I can use it without issues, however, my IDE thinks that the keras submodule in tf does not exist. I am using anaconda where I install tensorflow and all my other libraries. I make sure that I select the right interpreter in PyCharm (all my other obscure libraries are imported without issue) and the base module from tf is imported without any problem (I get autocomplete etc.) but when I import "tensorflow.keras" the IDE complains that it cannot find the reference 'keras'. As said above, executing the files works without problem. Is there a way to tell the PyCharm that there is actually a keras submodule?

PyCharm 2018.3.3 (Community Edition)
Build #PC-183.5153.39, built on January 9, 2019
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-43-generic

 

14
31 comments

Would it be possible to repair this? It has been around quite a bit already.

 

0

Please sign in to leave a comment.