8000 Tensorflow as an extra requirement by kenders2000 · Pull Request #117 · keunwoochoi/kapre · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tensorflow as an extra requirement #117

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

Closed
wants to m 8000 erge 4 commits into from

Conversation

kenders2000
Copy link
Contributor
@kenders2000 kenders2000 commented Jan 12, 2021

Hi, I was having trouble using kapre in a tensorflow docker container with a gpu as it is not aware of the presence of a GPU version of tensor flow, so I created a fork to address this issue.

With tensorflow listed under install_requires as tensorflow >= 2.0 if you have the gpu version of tensorflow (e.g. in a gpu enable docker container docker run -it --rm --runtime=nvidia tensorflow/tensorflow:latest-gpu python this will download and install the cpu version of tensorflow.

To get around this I have moved the tf dependancy to an extras_require. This changes the behaviour so that pip install kapre[tf] installs the cpu version and pip install kapre[tf_gpu] brings the gpu tf version. This is similar to:

tensorflow/tensorflow#7166 (comment)

pip install kapre still works but won't bring tensorflow, this seems to be the best way to deal with this problem as far as I can see. I modified the readme also.

@keunwoochoi
Copy link
Owner

Hi, thanks for the PR! 🤗
But, I'm not sure. I have the same situation in my dev environment in my job. Albeit the inefficiency, my workaround was to add an install script that install pip install . followed by pip uninstall tensorflow. Yes it sucks, but I still believe it is better to let people in my (and your) situation to do additional work than the other way.

@kenders2000
Copy link
Contributor Author

Hi thanks for having a look!
I understand: for me downloading and installing tensorflow can take up to 30 mins, (poor connection on our ML server). Hence making this change. But don't worry, if you think it is not applicable to the majority of users I can continue using my fork to get round this problem!
Cheers
Paul

@keunwoochoi keunwoochoi closed this Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0