Skip to content
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

Python code runs tensorflow-gpu 2.5, but the executable only runs with CPU!! #404

Open
aziabari opened this issue Apr 6, 2022 · 0 comments
Labels
state:triage We're still figuring out how severe this issue is

Comments

@aziabari
Copy link

aziabari commented Apr 6, 2022

My python code runs on multiple GPUs and runs perfectly with tensorflow-gpu.

Then I tried to package it with pyinstaller, but I got tensorflow issues.
I added a tensorflow hook (as follows) and resolved the issue.

from PyInstaller.utils.hooks import collect_all

def hook(hook_api):
packages = [
'tensorflow']
for package in packages:
datas, binaries, hiddenimports = collect_all(package)
hook_api.add_datas(datas)
hook_api.add_binaries(binaries)
hook_api.add_imports(*hiddenimports)

However, after creating and running the executable, it only runs on CPU.

  • OS: Ubuntu
  • Python Version: python 3.8
  • tensorflow-gpu: 2.5
  • Version of PyInstaller 4.2
@aziabari aziabari added the state:triage We're still figuring out how severe this issue is label Apr 6, 2022
@aziabari aziabari changed the title Python code runs tensorflow-gpu, but the executable only runs with CPU!! Python code runs tensorflow-gpu 2.5, but the executable only runs with CPU!! Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:triage We're still figuring out how severe this issue is
Projects
None yet
Development

No branches or pull requests

1 participant