-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
Replacement for ConvRNN API (implementing custom ConvGRU2D Cell) #19360
Comments
Hi @dryglicki , To better understand your enquiry can I have more context and details which worked for Keras2 and which is not working now with Keras3 with a minimal code snippet. Thanks! |
Hi Surya. Okay, I can provide a simpler example. The ConvGRU2DCell is a bit complicated, so I'll work on getting a simpler example that has all of its same parts but the call logic is reduced. Standby. |
@SuryanarayanaY All right, I created a gist here: https://gist.github.com/dryglicki/5f198807d5cd14f9cdd8b52d90dac211 If I try running that, I get the following error:
That GRU Cell is a minor modification of what I'm using in my development -- I took out Spectral Normalizations to make it easier to work with. Anyway, I've been spending a lot of time looking at the ConvLSTMCell implementation here: https://github.com/keras-team/keras/blob/master/keras/layers/rnn/conv_lstm.py It does look similar to what was in the older versions of Keras. I find this message to be alarming, however:
So does that mean ALL custom RNN-CNN cells have to follow this rule, or is it specific to this particular implementation of ConvLSTM? That would be a showstopper for me if that's the case where I can't set my inputs to include [None, None] in the [H, W] dimensions. |
...small update in gist to change |
There are no plans to bring back this API at this time. You can either use Keras 2 (which is available as the |
@fchollet All right, well that's not the best news. Thanks for your attention. I have a new surprise in a new ticket! |
Environment:
Miniforge conda installation; pip installation via instructions on main Tensorflow page with additional workarounds described here
Python version: 3.11.8
New versions:
Tensorflow: 2.16.1
Keras: 3.1.1
Old versions:
Tensorflow: 2.14.0
Keras: 2.14.1
Situation:
I wrote a custom ConvGRU2DCell. It worked in my generator this way:
Setting aside the "layout_optimizer" hack to get running, this worked. I couldn't get the regular RNN API to accept this properly at the time. Indeed, in the Keras RNN API, it looks like the RNN API is expecting a Tensor of shape [B, T, C]. Now, in the new version of Keras and TF, this ConvRNN wrapper is gone. Looking into ConvLSTM2D class, there is a ConvLSTM class that it inherits from that permits the "rank" argument.
Do I have any recourse here aside from coding it all from scratch or should I stick with the older versions of TF and Keras? Will this API return? Are we not meant to implement our own recurrent convolutional cells anymore? Did I screw something up when I first tried the RNN API?
The text was updated successfully, but these errors were encountered: