CityUHK-CompBio / DeepCC

DeepCC: a novel deep learning-based framework for cancer molecular subtype classification
https://CityUHK-CompBio.github.io/DeepCC/
MIT License
20 stars 16 forks source link

Error in train_DeepCC_model due to deprecated keras code #17

Closed compbiolover closed 1 year ago

compbiolover commented 1 year ago

Hi @gaofeng21cn and @zero19970, I’m attempting to use your DeepCC package but am encountering an error related to deprecated code. Error: ValueError: decay is deprecated in the new Keras optimizer, please check the docstring for valid arguments, or use the legacy optimizer, e.g., tf.keras.optimizers.legacy.Adam. In addition, it also has the following warning about another deprecated parameter. WARNING:absl: lr is deprecated, please use learning_rate instead, or use the legacy optimizer, e.g.,tf.keras.optimizers.legacy.Adam.

My entire code related to DeepCC is below:

fs <- getFunctionalSpectra(df) labels <- c("I","II","III","IV") deepcc_model <- train_DeepCC_model(fs, labels) df <- get_DeepCC_features(deepcc_model, fs)

I am using R 4.2.2, tensorflow 2.11 on macOS Big Sur (11.7.4). Will be happy to provide any additional details!

Thanks for all your hard work on this cool tool!

zero19970 commented 1 year ago

Hi Andrew,

It seems that you have installed the latest version of keras 2.11. The official statement shows that keras$optimizers$legacy have been replaced by keras$optimizers$legacy$Adam(). The fastest way to solve this problem is to install an older version of keras and tensorflow in R lower than 2.9.0.

Best wish, Chenghang

zero19970 commented 1 year ago

Hi Andrew,

In R environment, running keras::install_keras(version="2.9.0", tensorflow="2.9.0") is okay.

Best wish, Chenghang

compbiolover commented 1 year ago

Hi @zero19970, Thanks for clarifying this. I will install keras 2.9.0 and will re-open this issue if I still have problems!

Best wishes, Andrew