为了账号安全,请及时绑定邮箱和手机立即绑定

Tensorflow text_generation

Tensorflow text_generation

繁华开满天机 2021-10-12 10:49:56
我正在处理代码https://www.tensorflow.org/tutorials/sequences/text_generation当我到达该行时,会产生以下错误。 sampled_indices = tf.random.categorical(example_batch_predictions[0], num_samples=1) sampled_indices = tf.squeeze(sampled_indices,axis=-1).numpy()错误AttributeErrorTraceback (most recent call last)在----> 1 sampled_indices = tf.random.categorical(example_batch_predictions[0], num_samples=1)2 sampled_indices = tf.squeeze(sampled_indices,axis=-1).numpy()AttributeError: module 'tensorflow._api.v1.random' has no attribute 'categorical'系统信息 - TensorFlow 版本:Ubuntu 上的 1.12 Jupyter NoteBooks可能缺少什么的任何指示?我想知道是否缺少导入?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 165 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信