HuCaoFighting / Swin-Unet

[ECCVW 2022] The codes for the work "Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation"
1.77k stars 320 forks source link

Help debug! Thank you! #82

Open Txxxi opened 1 year ago

Txxxi commented 1 year ago

merge config from ./configs/swin_tiny_patch4_window7_224_lite.yaml SwinTransformerSys expand initial----depths:[2, 2, 6, 2];depths_decoder:[1, 2, 2, 2];drop_path_rate:0.2;num_classes:1 ---final upsample expand_first--- Traceback (most recent call last): File "train.py", line 93, in net = ViT_seg(config, img_size=args.img_size, num_classes=args.num_classes).cuda() File "/public/home/hpc204611063/.conda/envs/txxtorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 491, in cuda return self._apply(lambda t: t.cuda(device)) File "/public/home/hpc204611063/.conda/envs/txxtorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 387, in _apply module._apply(fn) File "/public/home/hpc204611063/.conda/envs/txxtorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 387, in _apply module._apply(fn) File "/public/home/hpc204611063/.conda/envs/txxtorch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 387, in _apply module._apply(fn)

tommasogattari commented 1 year ago

if torch.cuda.is_available() is equal to False it means that you dont have cuda available and you must install it. Otherwise you can avoid this problem changing cuda() to cpu() in train.py line 93