一、patch_size
我们修改了patch_size这一参数
影响的结果就是
导致更新迭代速度变得慢了起来,修改了batch,单次读入的图像,之前用的32*32*32,8的话相当于,之前120*8 < 64*32
查阅资料https://www.csdn.net/tags/NtjaUg5sNTE5MzUtYmxvZwO0O0OO0O0O.html
总结下来:batch size过小,花费时间多,同时梯度震荡严重,不利于收敛;batch size过大,不同batch的梯度方向没有任何变化,容易陷入局部极小值。
二,image的格式(2022-5-6)
image格式一定要从16bit转为8bit
然后再将所有图像保存起来,变成单个tif
三、修改spilt data中的尺寸大小
从【120,120,120】修改成【64,64,64】
后续训练的时候出错
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 64 and 47
改回去120 120 120 ,无异常,后续可修改config 【64,64,64】
四 如果无法看哪里出了问题,可以将结果可视化
pred_recon = reconstruct_from_patches(pred_Patches, patchindices, image.shape)
pred_recon = pred_recon.astype(np.uint8)
tifffile.imsave(os.path.join(recon_path, 'pseudo labels refinement\pred_recon.tif'), np.uint8(pred_recon * 255))
# prob recon (need)
prob_recon = reconstruct_from_patches(prob_patches, patchindices, image.shape)
tifffile.imsave(os.path.join(recon_path, 'pseudo labels refinement\prob_recon.tif'), np.uint8(prob_recon * 255))
五 Pixel 和 voxel 区别
像素是图片上的,体素是一个长宽高为一体的