Closed dsagman closed 8 months ago
Thanks for the report! I think you're correct that the issue was caused by some "internal" change in Keras or TensorFlow... I'd be curious which versions of those libraries you're using when seeing this issue?
The fix that you've suggested looks good to me. If you wouldn't mind creating a PR with this change that would be great! I can do a little more testing merge the change this weekend.
Great! I've submitted the pull request. Hopefully correctly. (This is my first PR.)
I am using Tensorflow 2.16.1, keras 3.1.1, and Python 3.11.6 on my Windows 11 laptop where I'm submitting from. I also have roughly the same current versions of each running on: Windows 11 desktop with NVIDIA, Mac M1 Mini, and Framework Intel 12th Gen Laptop with Manjaro (Arch variant). I've been doing development with RTNeural on all of these.
(Why not just use the desktop with the NVIDIA card? Because it's my son's so he only let's me use it when I buy him pizza and am able to distract him long enough to try to train a model.)
First, thanks for making this awesome library! We are using it as part of a project where we are seeing if we can increase performance on larger network layers using approximation techniques such as approximate activation, approximate matrix multiply, and loop perforation. If we get that working, we will share our results with you.
However, I ran into an issue where
save_layer
inmodel_utils.py
is giving me an error that:I found that
layer.output.shape
works, but isn't always a tuple, which runs afoul of the JSON encoder. So I added check for that too.I modified the code as follows and it seems to work on Macos, Linux, Windows. I've included my debugging print statements so you can see what I was looking at.
I suspect something changed in the keras internals in one of the versions, but can't find any reference to it.
Regardless, I hope this helps and is useful.