sydney0zq / covid-19-detection

The implementation of "A Weakly-supervised Framework for COVID-19 Classification and Lesion Localization from Chest CT"
110 stars 34 forks source link

关于decovnet输入图片尺寸 #6

Open 1170300725 opened 3 years ago

1170300725 commented 3 years ago

我使用cropresize文件将图片resize为224*336尺寸,但是在decovnet训练时发生错误:RuntimeError: Given input size: (64x1x56x84). Calculated output size: (64x0x56x84). Output size is too small,问题出现在baseline_i3d.py的248行,请问这可能是什么原因导致的

sydney0zq commented 3 years ago

@1170300725 你好,deCovNet的输入是一个5D的形式,BCSHW,其中B是batch size,C是channel,S是切片数目,HW为高和宽。

1170300725 commented 3 years ago

@1170300725 你好,deCovNet的输入是一个5D的形式,BCSHW,其中B是batch size,C是channel,S是切片数目,HW为高和宽。

谢谢,问题已经解决了。原因是我的在cropsize后出现了一部分空数据。除此之外我在运行cam-mask时出现了一些问题,在167行preds,features = model([ct_immasks.cuda()])这一语句中获取两个返回值,我用的model是baseline_i3d,这里只能返回一个preds,无法获取到features。

wjtan99 commented 3 years ago

In your data format BCSHW, does the S - the number of slices have to a fixed number, or it can be any arbitrary number?
Thanks.

sydney0zq commented 3 years ago

In your data format BCSHW, does the S - the number of slices have to a fixed number, or it can be any arbitrary number? Thanks.

这是可能的,但是需要修改部分代码,让S这一维度最终给分类器的数目是固定的。