Hello Everyone,
After installing multiple versions of tensorflow in conda virtual environment, I found out that tensorflow 2.0 creates seperate folders for tensorflow, tensorflow_core inside the site packages folder. The packages such as Python, tools are created in the tensorflow_core folder. While importing the tensorflow from matlab, it is executing the __init__.py file of tensorflow_core. In the __init__ file, it is trying to import packages from tensorflow not from tensorflow_core:
from tensorflow.python.tools import module_util as _module_util
Matlab is unable to find any python packages in tensorflow folder. So, it is throwing the error whereas for tensorflow 1.2, python package is created in tensorflow folder. Matlab is able to import tensorflow 1.2 library successfully.
Note: For importing keras in Matlab through python interface: I am able to import keras 2.0.3 version after commenting the line(72) sys.stderr.write('Using TensorFlow backend.\n') in __init__.py file placed in keras\backend folder.
Kindly someone let me know why the errors are getting displayed only in Matlab not in python command prompt as I am able to import tensorflow 2.0, keras without doing any modifications.