使用anaconda,我安装了python 3.8和tensorflow 2.5.0来运行名为DeepNovo的包。
但是DeepNovo需要python 2.7/tensorflow 1.2设置,所以我试图转换适合较低版本的代码。
当我试图运行这段代码时,我得到了以下错误:
File "/Data2/HJE/DeepNovo/deepnovo_model.py",第442行,在_build_cnn_ion .py"Cnn_ion_logit = rnn_cell_impl._linear(args=cnn_ion_feature,AttributeError:模块的tensorflow.python.ops。Rnn_cell_impl '没有属性'_linear'
看起来像"_linear"函数不可用于tensorflow 2。x版本。是否有任何兼容的代码tensorflow 2。X版本?
使用Tensorflow 1.x
from tensorflow.contrib.rnn.python.ops.rnn_cell import _Linear
或
from tensorflow.contrib.rnn.python.ops import core_rnn_cell
linear = core_rnn_cell._linear