Giter Club home page Giter Club logo

m3ae's Introduction

M3AE: Multimodal Representation Learning for Brain Tumor Segmentation with Missing Modalities

The code is preparing in few days.

Dataset: Brats 2018 and Brats 2020 or from RFnet for dataset and split files.

Training process:

  1. change the path in ./dataset/brats.py to your dataset path.
  2. run pretrain.py via pre.sh.
  3. change the pretrained chackpoint path in train_18.py and run it via run.py

If you have any questions, please do not hesitate to contact [email protected]

m3ae's People

Contributors

ccarliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

m3ae's Issues

ValueError: Using a target size (torch.Size([1, 128, 128, 128])) that is different to the input size (torch.Size([1, 128, 128])) is deprecated. Please ensure they have the same size.

你好 想請教一下在我完成了預訓練 然後得到tar檔 (使用Kaggle BraTs18 dataset)

之後在跑train.py的時候會出現
ValueError: Using a target size (torch.Size([1, 128, 128, 128])) that is different to the input size (torch.Size([1, 128, 128])) is deprecated. Please ensure they have the same size.

想請問該如何修復呢?

想问一下text_18_sum.py为什么会出现这种错误?这个checkpoint填的是预训练还是训练的啊?

Working with 1 GPUs
/media/jxust/磁盘2/m3ae-main/ours_brats18.tar
Namespace(accumulation_steps=None, amp_opt_level='O1', batch_size=1, cache_mode='part', cfg='configs/vt_unet_costum.yaml', checkpoint='/media/jxust/磁盘2/ae-main/ours_brats18.ta', checkpoint_folder=PosixPath('/media/jxust/磁盘2/m3ae-main/runs/tt/model_1'), devices='0', epochs=300, eval=False, exp_name='tt',old=0, lr=0.0003, mae_imp=True, mdp=0, modal_list=None, num_classes=3, resume=True, save_folder_1=PosixPath('/media/jxust/磁盘2/m3ae-main/runs/tt/model_1' seed=1234, seg_folder_1=PosixPath('/media/jxust/磁盘2/m3ae-main/runs/tt/model_1/segs'), start_epoch=0, tag=None, throughput=False, use_checkpoint=False, l=20, weight_decay=0, workers=8, zip=False)
Traceback (most recent call last):
File "test_18_smu.py", line 337, in
main(arguments)
File "test_18_smu.py", line 126, in main
ck = torch.load(args.checkpoint, map_location=torch.device('cpu'))
File "/home/jxust/anaconda3/envs/m3ae1/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/jxust/anaconda3/envs/m3ae1/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/jxust/anaconda3/envs/m3ae1/lib/python3.7/site-packages/torch/serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/media/jxust/磁盘2/m3ae-main/ours_brats18.ta'

A view was created in no_grad mode and is being modified inplace with grad mode enabled. This view was created inside a custom Function (or because an input was returned as-is) and the autograd logic to handle view+inplace would override the custom backward associated with the custom Function, leading to incorrect gradients. This behavior is forbidden. You can fix this by cloning the output of the custom Function.

Traceback (most recent call last):
File "pretrain.py", line 240, in
main(arguments)
File "pretrain.py", line 177, in main
segs_S1,mask_ratio,,= model_1(inputs_S1, patch_locations)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
return self.module(*inputs[0], **kwargs[0])
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/root/m3ae/model/Unet.py", line 830, in forward
x[l] = x[l] * mask + self.limage[:, :, location[0][0][l]: location[0][1][l], location[1][0][l]: location[1][1][l], location[2][0][l]: location[2][1][l]] * (1-mask) # not detach here
RuntimeError: A view was created in no_grad mode and is being modified inplace with grad mode enabled. This view was created inside a custom Function (or because an input was returned as-is) and the autograd logic to handle view+inplace would override the custom backward associated with the custom Function, leading to incorrect gradients. This behavior is forbidden. You can fix this by cloning the output of the custom Function.

实验求助

作者您好!
看了您的论文对我的启发很大,由于资源有限,可以向您要一下对比试验的权重文件吗,以及BraTS20(219:50:100 cases)数据的txt文件吗,冒昧打扰,祝您学术顺利,生活愉快。

Train Stop?

The train model needs to train 300 epochs from 0 to 299. But when I trained the 299 epoch. The train was stopped. Can you help me? How can I deal with this issue?
image

self.limage = nn.Parameter(torch.randn((1, 4, 155, 240, 240)))的作用是什么

self.limage = nn.Parameter(torch.randn((1, 4, 155, 240, 240)))的作用是什么,我在pretrain的时候,
self.limage[:,:,location[0][0]: location[0][1],location[1][0]: location[1][1],location[2][0]: location[2][1]] * (1-mask)在相乘时,两个shape对不上:
(1-mask).shape:
torch.Size([1, 4, 128, 128, 128])
self.limage[:,:,location[0][0]: location[0][1],location[1][0]: location[1][1],location[2][0]: location[2][1]].shape:
torch.Size([1, 4, 0, 128, 121])
请问这可能是什么原因,该怎么修改

预训练出现问题

image
预训练出现了这个问题,用的是brats2020的数据集,想问下怎么解决,感谢!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.