MrGiovanni / ModelsGenesis

[MICCAI 2019 Young Scientist Award] [MEDIA 2020 Best Paper Award] Models Genesis
Other
728 stars 139 forks source link

save memory and reduce computation costs. #28

Closed linchundan88 closed 4 years ago

linchundan88 commented 4 years ago

If I do classification task.

in TargetNet self.base_model(x) self.base_out = self.base_model.out512

Why not modify UNet3D.py

    if self.do_seg:
        self.out_up_256 = self.up_tr256(self.out512,self.skip_out256)
        self.out_up_128 = self.up_tr128(self.out_up_256, self.skip_out128)
        self.out_up_64 = self.up_tr64(self.out_up_128, self.skip_out64)
        self.out = self.out_tr(self.out_up_64)

        return self.out
    else:
        return self.out512

Doing so will save a lot of memory and FLOPS.

linchundan88 commented 4 years ago

It will reduce memory usage by half.

linchundan88 commented 4 years ago

I am wrong. I neglected Classification3D.