将tensorflow与elu一起使用时发生属性错误

问题描述 投票:0回答:1

尝试使用tensorflow库时出现属性错误输出

TF版本:

Name: tensorflow
Version: 2.0.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: c:\users\vinhalivinhali\appdata\local\programs\python\python35\lib\site-packages
Requires: tensorboard, wrapt, keras-preprocessing, protobuf, wheel, numpy, gast, tensorflow-estimator, termcolor, google-pasta, grpcio, absl-py, keras-applications, astor, opt-einsum, six
Required-by:

Python版本

Python 3.5.0

IMPORTS

import tensorflow as tf # for Deep Learning
import pandas as pd # for data manipulation
import numpy as np # for matrix manipulation
from matplotlib import pyplot as plt # for graphics

SCRIPT

X0 = X[:, 0, :] # get the data in the first time period
Ht = tf.elu(tf.matmul(X0, Wx_h) + b) # uses X0 to initiate the hidden state
y = [] # list to be populated with outputs every time period

输出

Traceback (most recent call last):
  File "rnrs.py", line 40, in <module>
    Ht = tf.elu(tf.matmul(X0, Wx_h) + b) # uses X0 to initiate the hidden state
AttributeError: module 'tensorflow' has no attribute 'elu'
tensorflow python-3.5
1个回答
0
投票

elu功能在tf.nn模块中,请参见documentation

© www.soinside.com 2019 - 2024. All rights reserved.