keras version issues when using n2v (noise2void) package

i am using M1 macbook air 2020. macOS Monterey version 12.4

i have been trying long and hard to install the n2v package https://github.com/juglab/n2v

i first created a virtual env using conda and installed tensorflow using https://developer.apple.com/metal/tensorflow-plugin/

afterwards, i did pip install n2v which led to its own set of problems. the main issues were imagecodecs and h5py. i resolved this issues and managed to install n2v. however there are these 2 issues.

  1. n2v 0.3.1 requires keras<2.4.0,>=2.1.1, but you have keras 2.9.0 which is incompatible.
  2. tensorflow-macos 2.9.2 requires keras<2.10.0,>=2.9.0rc0, but you have keras 2.3.1 which is incompatible.

as you can see this puts me in a tightspot. when i first installed tensorflow using the link, my tensorflow version was 2.9.2 and keras was 2.9.0. but then n2v 0.3.1 is not compatible keras 2.9.0. this requires me to downgrade keras but then tensorflow wouldnt work. i have been trying to figure out how to solve this for days. the tricky part about resolving these issues are there the help i find online must be for a macos context. using the macbook really complicates things as my understanding is that i cannot install tensorflow in a normal way but have to use tensorflow-macos.

please please help me! any help is greatly appreciated. thank you very much!

Hi @haidiazaman

So here the fundamental issue would be that the n2v package is based on relatively old versions of tensorflow and keras packages. Our tensorflow-macos releases only start from version 2.5.0 onwards because they require the pluggable device interface which was released back then in order to take advantage of the GPU on our devices. So here the only recommendation we can provide is to request the managers of that repository to update their package to use newer versions of these two dependencies. The repository also looks to be open for anyone to clone and edit the code so you could also try building the package from source after editing the required dependencies for tensorflow and keras. However since there is quite many major releases between the supported and the current ones this might need a lot of work if there have been changes to the APIs they are using.

keras version issues when using n2v (noise2void) package
 
 
Q