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

Error occurred during model training. #28

Open XLOXL opened 1 year ago

XLOXL commented 1 year ago

Hello, I didn't encounter any errors when training small amounts of data, but when I tried to train several Gs worth of data, I received the following error. Could you please advise me on how to fix it? Error:tensorflow.python.framework.errors_impl.InvalidArgumentError: len(seq_lens) != input.dims(0), (22 vs. 32) [[node token_lstm/bidirectional_rnn/bw/ReverseSequence (defined at /anaconda3/envs/DeepMicrobes-master/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

MicrobeLab commented 1 year ago

Hi, sorry I did not encounter such errors before and have no idea how to fix it.

XLOXL commented 1 year ago

Okay, thank you!

XLOXL commented 1 year ago

Hello, I have another question. The default batch size for training is 32, while the default batch size for prediction is 8192. I'm wondering what the difference is between the two and why the values are so different.

MicrobeLab commented 1 year ago

For prediction, the batch size has no effect on the results, so I tend to use the largest batch size that fits into memory. For training, batch size is an important hyper-parameter that users should carefully tune.

XLOXL commented 1 year ago

Okay, thank you!

XLOXL commented 1 year ago

Hello, have you encountered a similar error during prediction before? I have modified my num_classes, vocab_size, and k-mer. Error:Assign requires shapes of both tensors to match. lhs shape= [2505] rhs shape= [1] [[node save/Assign_7 (defined at /anaconda3/envs/DeepMicrobes-master/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

MicrobeLab commented 1 year ago

Hi, I have not encountered a similar error. It seems that the number of classes was left as the default 2505. Not sure why.

XLOXL commented 1 year ago

Okay, thank you very much for your patient response.