sksq96 / pytorch-summary

Model summary in PyTorch similar to `model.summary()` in Keras
MIT License
4k stars 412 forks source link

Do not support 3D CNN? #43

Open Tord-Zhang opened 5 years ago

Tord-Zhang commented 5 years ago

Right?

JimLee1996 commented 5 years ago

3DCNN is supported since I've already tested. Please paste your error message and code here.

zhonhel commented 3 years ago

I got error, when using 3D U-Net, please clone this repo to check: https://github.com/wolny/pytorch-3dunet

I use pytorch 1.9.0

Look at this repo. First change the file_paths item in ./resources/train_config_dice.yaml, with "{path to}/resources/sample_ovule.h5", both for train and val ( line 82 and line 139 ). Then run use python {path to}/pytorch3dunet/train.py --config {path to}/resources/train_config_dice.yaml

I inserted codes:

        from torchsummary import summary
        summary(self.model, (input.shape[1], input.shape[2], input.shape[3], input.shape[4]))
        exit()

before

        output = self.model(input)

in UNet3DTrainer._forward_pass(self, input, target, weight=None) this function.