Shen-Lab / DeepAffinity

Protein-compound affinity prediction through unified RNN-CNN
GNU General Public License v3.0
137 stars 30 forks source link

Typrerror when running joint-Model_test.py #16

Open HeJunhong1107 opened 6 months ago

HeJunhong1107 commented 6 months ago

I'm trying to use deep affinity with pretained error, but the error appeared :

Tokenizing data in ./data/test_sps Tokenizing data in ./data/test_smile File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 491, in apply_op preferred_dtype=default_dtype) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 704, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 577, in _TensorTensorConversionFunction % (dtype.name, t.dtype.name, str(t))) ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("GRU/GRU/GRUCell/Gates/add:0", shape=(64, 512), dtype=float32)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "joint-Model_test.py", line 230, in prot_gru_1 = tflearn.gru(prot_embd, GRU_size_prot,initial_state= prot_init_state_1,trainable=True,return_seq=True,restore=True) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tflearn/layers/recurrent.py", line 294, in gru scope=scope, name=name) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tflearn/layers/recurrent.py", line 67, in _rnn_template sequence_length=sequence_length) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 197, in static_rnn (output, state) = call_cell() File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 184, in callcell = lambda: cell(input, state) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tflearn/layers/recurrent.py", line 601, in call self.trainable, self.restore, self.reuse)) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1198, in split split_dim=axis, num_split=num_or_size_splits, value=value, name=name) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3306, in _split num_split=num_split, name=name) File "/home/recher/anaconda3/envs/deep_affinity/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 514, in apply_op (prefix, dtypes.as_dtype(input_arg.type).name)) TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.

HeJunhong1107 commented 6 months ago

here were my environment: 屏幕截图 2024-04-22 202110