Dataset: Brats 2018 and Brats 2020 or from RFnet for dataset and split files.
- change the path in ./dataset/brats.py to your dataset path.
- run pretrain.py via pre.sh.
- change the pretrained chackpoint path in train_18.py and run it via run.py
License: GNU Affero General Public License v3.0
即更新一下readme的内容,对新手会很有帮助,谢谢!
你好 想請教一下在我完成了預訓練 然後得到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.
想請問該如何修復呢?
pretrain模型,Unet3D_g输入shape为(1, 4, 18, 512, 512)时,报错RuntimeError: The size of tensor a (6) must match the size of tensor b (5) at non-singleton dimension 2,
调试发现是下采样和上采样后,u4和c3的shape不同,请问预训练的时候,输入的shape有限制吗
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'
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文件吗,冒昧打扰,祝您学术顺利,生活愉快。
This problem arises and how it should be solved
您好,我想问一下,我在运行第三步的时候args.checkpoint = “m3ae-main/mod/ours_brats18_pretrain.tar” 出现错误 FileNotFoundError: [Errno 2] No such file or directory: 'm3ae-main/mod/ours_brats18_pretrain.tar' 这是为什么?我放的位置不对吗?谢谢
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])
请问这可能是什么原因,该怎么修改
args.checkpoint = "m3ae-main/mod/ours_brats18_pretrain.pth" 这是什么问题哦?
有预训练模型吗
How long does it take to run 2 2080Ti
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.