diff --git a/neural_style.py b/neural_style.py index a5f8fc7..b820ec4 100644 --- a/neural_style.py +++ b/neural_style.py @@ -524,7 +524,7 @@ def read_weights_file(path): for i in range(1, len(lines)): line = lines[i].rstrip().split(' ') vals[i-1] = np.array(list(map(np.float32, line))) - vals[i-1] = list(map(lambda x: 0. if x < 255. else 1., vals[i-1])) + vals[i-1] = list([0. if x < 255. else 1. for x in vals[i-1]]) # expand to 3 channels weights = np.dstack([vals.astype(np.float32)] * 3) return weights