MicrobeLab / DeepMicrobes

DeepMicrobes: taxonomic classification for metagenomics with deep learning
https://doi.org/10.1093/nargab/lqaa009
Apache License 2.0
81 stars 21 forks source link

Running DeepMicrobes with TensorFlow 2.x #22

Open Mashin6 opened 1 year ago

Mashin6 commented 1 year ago

Hello, our GPU requires CUDA 11 and therefore I am stuck with using TensoFlow 2.x. I was trying to lift the code to TF2, but it seems I can't find a replacement for tf.contrib.rnn.CoupledInputForgetGateLSTMCell in the embed_lstm_attention model. Is there by any chance a version of DeepMicrobes that works with TF2? Alternatively, any pointers toward what could be a good replacement for CoupledInputForgetGateLSTMCell would help me a lot.

MicrobeLab commented 1 year ago

Hello, I'm not familiar with TF2, sorry. But I found this: https://discuss.tensorflow.org/t/corresponding-function-in-tfv2-x-x/3405

Mashin6 commented 1 year ago

Thanks, I'll check that out.

GiovanniFaldani commented 1 year ago

I solved this by changing tf.contrib.rnn.CoupledInputForgetGateLSTMCell to tf.compat.v1.nn.rnn_cell.LSTMCell in models/custom_layers.py

MicrobeLab commented 1 year ago

Great work, thanks!