ZhenZHAO / AD-MT

[ECCV'24] Alternate Diverse Teaching for Semi-supervised Medical Image Segmentation
https://arxiv.org/abs/2311.17325
22 stars 0 forks source link

Question Regarding AverageMeter Usage in train_post_2d_aut.py #3

Open codevisioner opened 1 month ago

codevisioner commented 1 month ago

Hi,

Thank you for the fantastic work and for sharing the code!

I encountered an issue when running the train_post_2d_aut.py script. Specifically, I get the following error:

meter_uns_losses = AverageMeter(20)
TypeError: AverageMeter.__init__() takes 1 positional argument but 2 were given

This seems to be related to the following section of the script:

# metric indicators
meter_sup_losses = AverageMeter()
meter_uns_losses = AverageMeter(20)
meter_train_losses = AverageMeter(20)
meter_learning_rates = AverageMeter()
meter_highc_ratio = AverageMeter()
meter_conflict_ratio = AverageMeter()
meter_uns_losses_consist = AverageMeter(20)
meter_uns_losses_conflict = AverageMeter(20)

It appears that the AverageMeter class (located in util.py) isn't designed to accept any arguments beyond the default self. Could you clarify if the AverageMeter initialization with values (e.g., 20) is necessary, or if we should modify this to work without the additional argument?

Thanks.

ZhenZHAO commented 3 weeks ago

Hi, I think the lenght param is optional, and shouldnt throw an error. please check the https://github.com/ZhenZHAO/AD-MT/blob/03ef84c79ae4db884133293cba647c571dbce25b/code/utils/util.py#L179. did you use a different one?

it is ok not to set a value or to use a different value.