我在处理密码
当我到达这一行时,会产生以下错误。
sampled_indices = tf.random.categorical(example_batch_predictions[0], num_samples=1)
sampled_indices = tf.squeeze(sampled_indices,axis=-1).numpy()错误
AttributeError
Traceback (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版本: 1.12 Ubuntu上的木星NoteBooks
有什么线索可以说明吗?我想知道是否缺少进口品?
发布于 2019-01-16 03:53:43
假设tf.random.categorical是logits:docs/python/tf/random/multinomial,那么example_batch_predictions可能已经更改为tf.random.multinomial
https://stackoverflow.com/questions/54210128
复制相似问题