weir12 / DENA

Deep learning model used to detect RNA m6a with read level based on the Nanopore direct RNA data.
MIT License
22 stars 5 forks source link

"UnboundLocalError: local variable 'f4' referenced before assignment" in LSTM_predict.py #5

Closed YCCHEN23 closed 2 years ago

YCCHEN23 commented 2 years ago

Thanks for the quick response to previous question, and sorry for the late reply due to Chinese new year.

I successfully downloaded the trained model, but while I performed the LSTM_predict.py, I received the following message:

(DENA) ycc@A326:~$ python DENA/step4_predict/LSTM_predict.py -i /mnt/858ed1f5-8772-42cf-9d70-f9dc3b880628/WT_Dark_R1/ \
>                                                    -m ~/DENA/DENA-lstm/ \
>                                                    -o /mnt/858ed1f5-8772-42cf-9d70-f9dc3b880628/WT_Dark_R1/ \
>                                                    -p WT_Dark_R1_predict
[PosixPath('/home/ycc/DENA/DENA-lstm/AGACA/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/AGACC/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/GGACT/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/AGACT/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/AAACC/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/GAACC/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/GGACA/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/GGACC/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/GAACA/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/AAACA/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/AAACT/model_best.pth'), PosixPath('/home/ycc/DENA/DENA-lstm/GAACT/model_best.pth')]
We found 12 well-trained model file
Traceback (most recent call last):
  File "DENA/step4_predict/LSTM_predict.py", line 118, in <module>
    main()
  File "DENA/step4_predict/LSTM_predict.py", line 110, in main
    if f4:
UnboundLocalError: local variable 'f4' referenced before assignment

Best regards YCCHEN

weir12 commented 2 years ago

Hi: Would you mind testing the new version of the script to check if there are still the same errors in your environment. a933a6e59075b33fe5d1cdd136869be5e3842879

I wish you a Happy Chinese new year Weir

YCCHEN23 commented 2 years ago

Thanks! The new version seems to perform well, and the m6A information is recorded, properly.

I'll close the issue after finishing all my data if there have no further errors.

YCCHEN