有如下定義損失函式的代碼:
losses = tf.contrib.legacy_seq2seq.sequece_loss_by_example(
[tf.reshape(self.pred, [-1], name='reshape_pred')],
[tf.reshape(self.ys, [-1], name='reshape_target')],
[tf.ones([self.batch_size * self.n_steps], dtype=tf.float32)],
average_across_timesteps=True,
softmax_loss_function=self.msr_error,
name='losses')
但是報了這樣的錯誤:
AttributeError: module 'tensorflow.contrib.legacy_seq2seq' has no attribute
'sequece_loss_by_example'
不知道是什么原因,感覺和tensorflow版本有關系,我的版本是1.14.0,哪位大佬能幫我解決一下?萬分感謝!
uj5u.com熱心網友回復:
是cuda版本過高了,你需要把cuda版本降下來轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/121565.html
標籤:人工智能技術
上一篇:記首次發博客的激動
下一篇:學生黨,加急!!!
