Open abrozzi opened 2 years ago
Dear Liang Yu,
I made the following changes:
In predict_new_seq.py
I added:
from keras_preprocessing.sequence import pad_sequences
and changed:
#x_seq = np.array(utils.pad_seq(seq, maxlen))
#x_bi = np.array(utils.pad_seq(bi, maxlen))
#x_tri = np.array(utils.pad_seq(tri, maxlen))
#x_acc = np.array(utils.pad_seq(acc, maxlen))
#x_acc20 = np.array(utils.pad_seq(acc20, maxlen))
#x_ss = np.array(utils.pad_seq(ss, maxlen))
#x_ss8 = np.array(utils.pad_seq(ss8, maxlen))
x_seq = np.array(pad_sequences(seq, maxlen))
x_bi = np.array(pad_sequences(bi, maxlen))
x_tri = np.array(pad_sequences(tri, maxlen))
x_acc = np.array(pad_sequences(acc, maxlen))
x_acc20 = np.array(pad_sequences(acc20, maxlen))
x_ss = np.array(pad_sequences(ss, maxlen))
x_ss8 = np.array(pad_sequences(ss8, maxlen))
The output of
python3 predict_new_seq.py test/new_test.fasta test/new_test.ss test/new_test.ss8 test/new_test.acc test/new_test.acc20 test/new_test_src_bio new_test
is
load data...
make data...
-----------------------------------------------
x_seq shape: (2, 1200)
x_bi shape: (2, 1200)
x_tri shape: (2, 1200)
x_acc shape: (2, 1200)
x_acc20 shape: (2, 1200)
x_ss shape: (2, 1200)
x_ss8 shape: (2, 1200)
x_bio shape: (2, 57)
2022-09-01 14:05:02.803012: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
1/1 [==============================] - 1s 968ms/step
-----------------------------------------------
EPSOL prediction finished!
and
cat new_test_prediction.txt
Predicted_Class P0 P1
1 0.31234664 0.68765336
0 0.69362843 0.30637154
Liang Yu, is it the result correct?
HTH -A
Dear Liang Yu,
running the test example (
new_test.fasta
) I get this errorThank you in advance