【发布时间】:2020-04-24 20:08:51
【问题描述】:
结节识别模型
此模型将肺部扫描(3D 图像)中的一个小体积(块)作为输入,并将该块分为两类:
Class 0 : Chunk does not contain a nodule
Class 1 : Chunk contains a nodule
我在这部分遇到了这个错误:UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype(' dtype('
def get_validation_batch(validation_x_ids,validation_y,batch_number): num_images = len(validation_x_ids)
count = 0
start_index = batch_number * FLAGS.batch_size
end_index = start_index + FLAGS.batch_size
end_index = num_images if end_index > num_images else end_index
real_batch_size = end_index - start_index
validation_x = np.ndarray([real_batch_size, FLAGS.chunk_size, FLAGS.chunk_size, FLAGS.chunk_size, 1], dtype=np.float32)
for chunk_id in validation_x_ids[start_index : end_index]:
chunk = np.load(DATA_PATH + chunk_id + '_X.npy').astype(np.float32, copy=False)
validation_x[count, :, :, :, :] = img_to_rgb(chunk)
count = count + 1
return validation_x, validation_y[start_index : end_index]
【问题讨论】:
标签: python-3.x deep-learning bigdata conv-neural-network