Open ethanbb opened 5 months ago
We have someone working this summer on swapping from tensorflow to pytorch; for now I'm going to hold on merging this, but there's a chance we may need it so let's leave it open as a PR until we know if it's needed. Thanks for putting in the time to find a solution.
hmm i hit this issue when trying to enabled Python 3.12 at conda-forge. Just wanted to resurface this.
I went an other way with my attempt, but it failed at the tests.
@hmaarrfk this approach should work if you have tensorflow 2.15 or newer installed, I believe. You have to install the corresponding version of tf-keras (conda should find the right version automatically).
The reason I did it this way is that tf-keras is only available for 2.15 or newer, and we still need to support older versions of tensorflow (Windows is stuck at 2.10).
Manuel's efforts to port all of caiman's tensorflow code to pytorch are not that far off from being ready to land, although this may pose some (different) packaging problems for Windows; apparently conda-forge doesn't have any Windows builds of pytorch.
These GPU acceleration libraries are no end of trouble for cross-platform projects. Trying to figure out how to navigate all of this.
Description
This provides a way to continue using Keras 2 with TensorFlow 2.16.1 (see #1355) by following the instructions here: https://github.com/tensorflow/tensorflow/releases/tag/v2.16.1 While sticking with 2.15.0 should still work for most people, I had an annoying CUDA situation which was only fixed by upgrading, so I wanted to see if I could make 2.16 work.
It's somewhat hacky (especially in nn_models.py), but since the long-term goal is to move away from TensorFlow anyway, I thought that was OK. No worries if you don't want to merge this, though.
It requires a matching version of
tf-keras
to be installed alongside tensorflow, but this package is only available for 2.15 and 2.16, so it won't work on Windows where tensorflow 2.10 is the maximum. So there would have to be some OS-dependent logic in the environment specification; I didn't touch any of that and I think it might be only possible for the conda recipe (i.e. not inenvironment.yml
).Type of change
Please delete options that are not relevant.
Has your PR been tested?
Ran
caimanmanager test
andcaimanmanager demotest
.