haotianteng / Chiron

A basecaller for Oxford Nanopore Technologies' sequencers
Other
122 stars 53 forks source link

Training issues about new version of Chiron #53

Closed qianlou closed 6 years ago

qianlou commented 6 years ago

Hi Teng,

Thanks for your previous advice and updates. I used wget command to download your data.genomicsresearch.org/Projects/basecall/Human_CHR19/file_batch data. After that, I used "python chiron/chiron_train.py -i /home/louqian/Chiron/traindata/ -o /home/louqian/Chiron/trainlog/ -m train_test " to train my new model. But there is a error and I attached the output on error1.txt. error1.txt. I found that the definition of inference function in chiron_model file has five parameters, but there are 4 parameters in chiron_train file when calls this inference function. Maybe this is a bug. I also tried another trainning method which uses chiron_rcnn_train.py. I used chiron/utils/raw.py to generate tf.records , signal and label data. But I can't still train it. Can you try these two methods again? Any advice will be appreciated.

Sincerely, Qian

haotianteng commented 6 years ago

Can you git pull to update Chiron to the latest version?

On Fri., 25 May 2018, 11:37 pm qianlou, notifications@github.com wrote:

Hi Teng,

Thanks for your previous advice and updates. I used wget command to download your data.genomicsresearch.org/Projects/basecall/Human_CHR19/file_batch data. After that, I used "python chiron/chiron_train.py -i /home/louqian/Chiron/traindata/ -o /home/louqian/Chiron/trainlog/ -m train_test " to train my new model. But there is a error and I attached the output on error1.txt. error1.txt https://github.com/haotianteng/Chiron/files/2040990/error1.txt. I found that the definition of inference function in chiron_model file has five parameters, but there are 4 parameters in chiron_train file when calls this inference function. Maybe this is a bug. I also tried another trainning method which uses chiron_rcnn_train.py. I used chiron/utils/raw.py to generate tf.records , signal and label data. But I can't still train it. Can you try these two methods again? Any advice will be appreciated.

Sincerely, Qian

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haotianteng/Chiron/issues/53, or mute the thread https://github.com/notifications/unsubscribe-auth/AKo3X5GhBjZVHvfKpG58RPc93SOpbD9lks5t2Ie1gaJpZM4UOpxa .

qianlou commented 6 years ago

Thanks for your advice, Teng. The latest version deals with my last question. But now when I run it, the console prints "model init finished, begin trainning". Then after 30 minutes, there is no other reactions and prints. So did you see this question?

Sincerely, Qian

haotianteng commented 6 years ago

No I didn't encounter this problem, so the model geaph has been created successfully if you see the message, it runs fine on my PC, what is your hardware setting?

On Sun., 27 May 2018, 2:57 am qianlou, notifications@github.com wrote:

Thanks for your advice, Teng. The latest version deals with my last question. But now when I run it, the console prints "model init finished, begin trainning". Then after 30 minutes, there is no other reactions and prints. So did you see this question?

Sincerely, Qian

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haotianteng/Chiron/issues/53#issuecomment-392299718, or mute the thread https://github.com/notifications/unsubscribe-auth/AKo3X6aS6MYvoRyfgu1bdc_h3-n84gJxks5t2ggLgaJpZM4UOpxa .

qianlou commented 6 years ago

I have solved last problem by changing mu hardware. Thanks for your help, Teng. But When I read the codes of Chiron and your Journal paper about Chiron, I don't know when and where you add CNN model and compute CNN model. You know, the default model of Chiron is CNN+RNN+CTC in your Journal paper. But in Chiron code, in inference function of Chiron_model, there is a piece of key code: if configure['rnn']['layer_num'] == 0: logits = getcnnlogit(cnn_feature) else: logits = rnn_layers(cnn_feature, sequence_len, training, layer_num = configure['rnn']['layer_num'], hidden_num = configure['rnn']['hidden_num'], cell=configure['rnn']['cell_type']) So these codes mean that because of configure['rnn']['layer_num'] !=0, the default model you have trained does not contain CNN model, just include RNN? Because this code can compute getcnnlogit() function only if configure['rnn']['layer_num'] ==0. But when I profile Chiron, I can see there are some Convo2D operations before RNN. So I am very curious about how did you add CNN model and how did you compute CNN model and get CNN logits which will be as the inputs of RNN. Can you discuss this question with me? Any response will be appreciated.

haotianteng commented 6 years ago

The model will always contain one or several CNN layers, set rnn_layer=0 will make the model only use CNN, getcnnlogits function is used to transfer the CNN output directly to a logits. If rnn layer>0, the getcnnfeature function will be called instead, and will pass the CNN output to RNN.

For model construction, please take a look at the chiron_model.py module, and also the cnn.py and rnn.py module.

Thank you Teng

On Sun., 27 May 2018, 10:24 pm qianlou, notifications@github.com wrote:

I have solved last problem by changing mu hardware. Thanks for your help, Teng. But When I read the codes of Chiron and your Journal paper about Chiron, I don't know when and where you add CNN model and compute CNN model. You know, the default model of Chiron is CNN+RNN+CTC in your Journal paper. But in Chiron code, in inference function of Chiron_model, there is a poece of key code: if configure['rnn']['layer_num'] == 0: logits = getcnnlogit(cnn_feature) else: logits = rnn_layers(cnn_feature, sequence_len, training, layer_num = configure['rnn']['layer_num'], hidden_num = configure['rnn']['hidden_num'], cell=configure['rnn']['cell_type']) So these codes mean that because of configure['rnn']['layer_num'] !=0, the default model you have trained does not contain CNN model, just include RNN? Because this code can compute getcnnlogit() function only if configure['rnn']['layer_num'] ==0. But when I profile Chiron, I can see there are some Convo2D operations before RNN. So I am very curious about how did you add CNN model and how did you compute CNN model and get CNN logits which will be as the inputs of RNN. Can you discuss this question with me? Any response will be appreciated.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haotianteng/Chiron/issues/53#issuecomment-392374063, or mute the thread https://github.com/notifications/unsubscribe-auth/AKo3X5pluxVkGEBU92xUIKiHv4yi_kh7ks5t2xmTgaJpZM4UOpxa .

haotianteng commented 6 years ago

The model will always contain one or several CNN layers, set rnn_layer=0 will make the model only use CNN, getcnnlogits function is used to transfer the CNN output directly to a logits. If rnn layer>0, the getcnnfeature function will be called instead, and will pass the CNN output to RNN.

For model construction, please take a look at the chiron_model.py module, and also the cnn.py and rnn.py module.

Thank you Teng

qianlou commented 6 years ago

Thanks for your reply,Teng. I have read all chrion_model.py, cnn.py and rnn.py. I know the getcnnfeature() function will be called whenever rnn layer>0 or not. But from my opinion, getcnnfeature() function does't include any operations such as matrix multiply or convolution operations just some reshape operations. Can getcnnfeature() function get CNN output from signal input? Sincerely, Qian