zahid58 / TwoStreamSepConvLSTM_ViolenceDetection

Code for the paper: "Efficient Two-Stream Network for Violence Detection Using Separable Convolutional LSTM"
MIT License
55 stars 13 forks source link

warning and wrong number of parameters in tensorflow2.6.0 #12

Open hoamcikd opened 3 years ago

hoamcikd commented 3 years ago

when i use the code in tensorflow 2.6.0 there is a warning when i run the code. WARNING:tensorflow: The following Variables were used a Lambda layer's call (tf.keras.backend.rnn), but are not present in its tracked objects: <tf.Variable 'SepConvLSTM2D_1/depth_kernel:0' shape=(3, 3, 56, 4) dtype=float32> <tf.Variable 'SepConvLSTM2D_1/point_kernel:0' shape=(1, 1, 56, 256) dtype=float32> <tf.Variable 'SepConvLSTM2D_1/recurrent_depth_kernel:0' shape=(3, 3, 64, 4) dtype=float32> <tf.Variable 'SepConvLSTM2D_1/recurrent_point_kernel:0' shape=(1, 1, 64, 256) dtype=float32> <tf.Variable 'SepConvLSTM2D_1/bias:0' shape=(256,) dtype=float32> It is possible that this is intended behavior, but it is more likely an omission. This is a strong indication that this layer should be formulated as a subclassed Layer rather than a Lambda layer. WARNING:tensorflow: The following Variables were used a Lambda layer's call (tf.keras.backend.rnn_1), but are not present in its tracked objects: <tf.Variable 'SepConvLSTM2D_2/depth_kernel:0' shape=(3, 3, 56, 4) dtype=float32> <tf.Variable 'SepConvLSTM2D_2/point_kernel:0' shape=(1, 1, 56, 256) dtype=float32> <tf.Variable 'SepConvLSTM2D_2/recurrent_depth_kernel:0' shape=(3, 3, 64, 4) dtype=float32> <tf.Variable 'SepConvLSTM2D_2/recurrent_point_kernel:0' shape=(1, 1, 64, 256) dtype=float32> <tf.Variable 'SepConvLSTM2D_2/bias:0' shape=(256,) dtype=float32> It is possible that this is intended behavior, but it is more likely an omission. This is a strong indication that this layer should be formulated as a subclassed Layer rather than a Lambda layer. besides the model parameters number are wrong in 2.6.0 and in model summary, instead of SepConvLSTM2D_1 and SepConvLSTM2D_2 there is tf.compat.v1.zeros_like and some variables like that. but everything is fine in tensorflow2.5.0 how should i solve it?

zahid58 commented 2 years ago

the codes were tested only on tf 2.5.0, tf 2.3.1