AttributeError: module 'tensorflow' has no attribute 'truncated_normal'
时间: 2023-10-19 07:06:29 浏览: 130
This error occurs when you are trying to use the "truncated_normal" function from the TensorFlow library, but the function is not available in the version of TensorFlow you are using.
The "truncated_normal" function is used to generate random values from a truncated normal distribution, which is a normal distribution with values outside a certain range truncated to that range. This function was available in previous versions of TensorFlow, but it has been deprecated and is no longer available in newer versions of TensorFlow.
To fix this error, you can try using an alternative function that achieves the same result, such as "random_normal" or "random.truncated_normal". Alternatively, you can try downgrading your TensorFlow version to a version that includes the "truncated_normal" function.
阅读全文