an intermediate Keras symbolic input/output, to a TF API that does not allow registering custom dispatchers, such as `tf.cond`, `tf.function`, gradient tapes, or `tf.map_fn`. Keras Functional model construction only supports TF API calls that *do* su

183 views
Skip to first unread message

Priyanshu Raj Jindal

unread,
Jul 8, 2023, 7:15:55 AM7/8/23
to Keras-users

google colab RL PPO Model

Hi I am Priyanshu and I want help with the error in the above google collab file I have tried changing shape etc. but not able to find what to do , please tell how the error can be resolved by telling what should I add and where and the reason for the error

Philip Oyier

unread,
Jul 12, 2023, 4:54:00 AM7/12/23
to Keras-users
Colleagues,
I have developed a CNN 1D for some DNA sequences
The source DNA data is unlabeled, thus used Kmeans to get the labels from the data, then feed the data and labels into a 1D Model

I get an error when I fit indicating mismatch between data and labels

Input data size (2000,200,1)
Label data size (2000,200,1) or (2000,200)

Please advise where I missed a step
Regards 

On Sat, Jul 8, 2023, 2:15 PM Priyanshu Raj Jindal <prj1...@gmail.com> wrote:

google colab RL PPO Model

Hi I am Priyanshu and I want help with the error in the above google collab file I have tried changing shape etc. but not able to find what to do , please tell how the error can be resolved by telling what should I add and where and the reason for the error

--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keras-users/fac43d65-1e5d-4c98-9626-9cf74e5c803fn%40googlegroups.com.


Alberto Matuozzo

unread,
Jul 13, 2023, 10:32:57 AM7/13/23
to Philip Oyier, Keras-users
Hi,

C1D layers do not have a channel dimension, therefore in the Input data size (2000,200,1), if  the  1 represents the channel, as if it was a black and white image, you should reshape the data to get rid of it.

Hope this helps


Philip Oyier

unread,
Jul 13, 2023, 11:49:37 AM7/13/23
to Alberto Matuozzo, Keras-users
Dear Alberto,
Have tried but I seem not to find the error, would you kindly take a look?
I share the notebook and dataset
Best
DNA_Test_Data_1DCNN_Colab_Version.ipynb
test_sequences.csv

Philip Oyier

unread,
Oct 9, 2023, 5:38:01 AM10/9/23
to Keras-users
Dear Colleagues,
I managed to handle the shape challenge, used a consistent encoding method and the models worked
I saved the models in HDF5 file, and wanted to use it with another dataset, preprocessed using the same encoding technique
The saved model shape is (None, 50, 1), while the local dataset shape is (57636, 60)

When loading the saved model and running with the local dataset, I get the error 
ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 50, 1), found shape=(None, 60)
I tried reshaping the local dataset to (-1, 50) but got the error 
ValueError: cannot reshape array of size 3458160 into shape (50,1)

Any best practices to follow and solve this problem?
Regards
Reply all
Reply to author
Forward
0 new messages