【问题标题】:module 'tensorflow' has no attribute 'set_random_seed' for RASA NLU supervised embeddings pipeline trainer模块“tensorflow”没有用于 RASA NLU 监督嵌入管道训练器的属性“set_random_seed”
【发布时间】:2020-09-16 09:14:06
【问题描述】:

所以我尝试使用监督嵌入管道来训练我的数据。

  • Rasa 版本:1.10.12

  • Tensorflow 版本:2.1.1

  • Rasa NLU:0.15.1

  • config.yml 包含以下内容:

语言:“en”

管道:“监督嵌入”

我在笔记本上运行它,但我不断收到关于 tensorflow 的错误:

 from rasa_nlu.training_data import load_data

 from rasa_nlu.config import RasaNLUModelConfig

 from rasa_nlu.model import Trainer 

 from rasa_nlu import config

 #Loading DataSet 

 train_data = load_data(my_data)

 #Config Backend: Supervised embeddings 

 trainer = Trainer(config.load('drive/Colab Notebooks/config.yml'))
 
 trainer.train(train_data)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-1a55633df253> in <module>()
----> 1 trainer.train(train_data)

1 frames
/usr/local/lib/python3.6/dist-packages/rasa_nlu/classifiers/embedding_intent_classifier.py in train(self, training_data, cfg, **kwargs)
    518             # set random seed
    519             np.random.seed(self.random_seed)
--> 520             tf.set_random_seed(self.random_seed)
    521 
    522             self.a_in = tf.placeholder(tf.float32, (None, X.shape[-1]),

AttributeError: module 'tensorflow' has no attribute 'set_random_seed'

根据我在其他论坛上发现的有关此错误类型的信息,tf.set_random_seed(self._seed) 需要移至 tf. random.set_seed() 但在这种情况下我无法访问 /usr/local/lib/python3.6/dist-packages/rasa_nlu/classifiers/embedding_intent_classifier.py 并更改它。

关于如何解决这个问题的任何想法?

谢谢,

【问题讨论】:

    标签: python tensorflow training-data rasa-nlu rasa


    【解决方案1】:

    解决方案:我使用 !pip install rasa==1.1.4 而不是 !pip install rasa,因为 supervised_embeddings em> 管道在新版本的 RASA 上已被弃用。

    【讨论】:

      猜你喜欢
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 2018-09-22
      • 2018-10-24
      • 1970-01-01
      • 1970-01-01
      • 2012-10-22
      • 1970-01-01
      相关资源
      最近更新 更多