win10下的python3程序報錯如題,
TypeError: float() argument must be a string or a number, not 'map'
具體出錯的語句:
image_batch = np.array(map(lambda x: ndimage.imread(x, mode='RGB'), image_batch_file)).astype(np.float32)
網上查到map外要加list(),改成下面語句就解決了:
image_batch = np.array(list(map(lambda x: ndimage.imread(x, mode='RGB'), image_batch_file))).astype(np.float32)