from PyInstaller.utils.hooks import collect_submodules, collect_data_files

hiddenimports = collect_submodules('tensorflow')
datas = collect_data_files('tensorflow', subdir=None, include_py_files=True)
