Hi, I´m having problems executing the function preprocess_features(features) in train.py.
def preprocess_features(features):
"""Row-normalize feature matrix and convert to tuple representation"""
rowsum = np.array(features.sum(1)) # <<<--- ERROR
r_inv = np.power(rowsum, -1).flatten()
r_inv[np.isinf(r_inv)] = 0.
r_mat_inv = sp.diags(r_inv)
features = r_mat_inv.dot(features)
return sparse_to_tuple(features)
The error is: 'tuple' object has no attribute 'sum'
Could somebody help me in solving this issue?
Thank you
Hi, I´m having problems executing the function preprocess_features(features) in train.py.
def preprocess_features(features):
"""Row-normalize feature matrix and convert to tuple representation"""
rowsum = np.array(features.sum(1)) # <<<--- ERROR
r_inv = np.power(rowsum, -1).flatten()
r_inv[np.isinf(r_inv)] = 0.
r_mat_inv = sp.diags(r_inv)
features = r_mat_inv.dot(features)
return sparse_to_tuple(features)
The error is: 'tuple' object has no attribute 'sum'
Could somebody help me in solving this issue?
Thank you