-
Notifications
You must be signed in to change notification settings - Fork 17
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
Tensorflow CPU vs GPU #68
Comments
Yes, that section needs to be updated (cf. #35). But the real problem is that TF2 dependencies are lurking everywhere, so we will very soon have the unacceptable state that no catch-all venv (satisfying both TF1 and TF2 modules) is possible anymore. By then, a new solution needs to be in place, which (at least partially) isolates venvs from each other again.
But isn't that equally true for using |
Nah, they had recommended |
Is there a chance to upgrade everything to Tensorflow 2? |
Code migration is not so difficult – yes, that could be streamlined in a coordinated PR effort. But IIRC the hard problem is that models will be incompatible and thus have to be retrained. This is something that the module providers have to decide on whether and when it is prudent themselves. And it's highly unlikely the time frames will converge. |
Of course there is a chance, it just involves quite a bit of work. For a maintained software like
This stuff is a. not super high on priority lists because of effort vs. benefit, b. takes time and c. sometimes depends on other software involved. ocrd_all will always have to deal with version conflicts. And I imagine there are research projects that have no maintainance anymore or maybe just some poor PhD student with other priorities. |
I do not get GPU support with that, only CPU. With |
Maybe existing models can be converted, too? |
In some cases this is possible. But not for e.g. Calamari 0.3.5 → 1.0, unless they support it. |
Alright, these are my results using the below script:
Script:
|
So, |
Indeed! We should open issues/PRs to all directly or indirectly affected module repos. (Strange though, I have a clear memory of getting GPU support out of a |
Behaviour changed between releases, so that explains it: |
Bad news: With |
These TF devs keep driving me mad. I thought we had this solved by now. Okay, can you re-label the prebuilt |
Yes, that is possible. Of course there remains the conflict between TF1 and TF2, so the resulting installation won't work. |
Building TF is a nightmare. It takes days for ARM, and I expect many hours for macOS. |
I don't think this is the right approach. First of all, you don't discriminate the version you are delegating to. And second, this requires to install I was thinking along the lines of modifying the name in the official wheel. |
I know. And it never quite works out of the box as documented (at least for me). Too fast to die, too slow to live. But building from scratch trivially gives you whatever package name you want. (So we could have @kba your thoughts? |
So, except for ARM and macOS and Python 3.8 support (it just keeps growing) – which we should probably discuss in #147 – I think this has been solved by #118. @mikegerber can we close? |
https://github.com/OCR-D/ocrd_all#conflicting-requirements states that ocrd_calamari would depend on tensorflow-gpu 1.14.x, but it depends on 1.15.2 since recently.
There is also still some solvable(!) problem/confusion about the different TensorFlow flavours. For tensorflow 1.15.*, one can simply depend on
tensorflow-gpu == 1.15.*
for CPU and GPU support. I am not aware of any issues usingtensorflow-gpu
's CPU fallback on CPU, I use it every day. (There was some source of additional confusion because TF changed their recommendation for 1.15 only.)I just recently discovered that one can depend on an approximate version, e.g.
tensorflow-gpu ~= 1.15.2
ortensorflow == 1.15.*
TL&DR: My recommendation would be that our TF1 projects just use
tensorflow-gpu == 1.15.*
for CPU and GPU support and be done with this problem.The text was updated successfully, but these errors were encountered: