Comments (10)
Hello, many thanks for your questions! Sorry for the late reply.
1)
1.1) Please note that the images saved in .npy are normalized.
1.2) Some 2D slices would have no LABELS if those slices do not cover any organs. But I assume all IMAGE slices should have values.
1.3) Could you please kindly print like np.sum(image) to see if the data are all 0.
- I think this repo is generalized well to other dataset.
2.1) For 3D dataset, you could directly follow the code/setting of this repo. I assume most of the 3D CT scans have the shape (512, 512, Z).
If you want to run many dataset at the same time in one project, there is a interface for dataset configuration (See './train.py' line 58-64.)
2.2) The project also support 2D dataset since the network is a 2D network, and it can have outstanding performance as well if the scenario requires long-range attention like multi-organ. If you want to train you own 2D dataset, I think you just have to modify the test script and pay attention to the augmentation since current project does not include random crop augmentation / random online scale.
Please let me know if you have specific questions if you start to implement your own dataset. I am willing to share my thoughts.
Thanks!
from transunet.
Hi,many thanks you for your answer.
- I used np.sum() to find that the value of the data is not 0. This is my mistake
- I have prepared my own 2D single channel bacterial data set with the size of 512*512. What I want to do is binary classification problem. Like your data, I converted the PNG file to NPZ file and modified the train.txt (in list_Synapse) and put them into the correct path.Here's where I changed the code:
1.See './train.py' line 33-------->default=512
2.See './train.py' line 62-------->'num_classes': 2,
3.See './trainer.py' line 36-------->num_workers=1
but i got the error:
(I think the reason is : nn.CrossEntropyLoss(input, target):The number of columns in input and target do not match
But I haven't found out how to change it so far. Could you help me?Thank you very much)
``load_pretrained: grid-size from 14 to 32
Namespace(base_lr=0.01, batch_size=5, dataset='Synapse', deterministic=1, exp='TU_Synapse512', img_size=512, is_pretrain=True, list_dir='./lists/lists_Synapse', max_epochs=50, max_iterations=30000, n_gpu=1, n_skip=3, num_classes=2, root_path='../data/Synapse/train_npz', seed=1234, vit_name='R50-ViT-B_16', vit_patches_size=16)
The length of train set is: 200
40 iterations per epoch. 2000 max iterations
0%| | 0/50 [00:00<?, ?it/s]/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [9,0,0], thread: [256,0,0] Assertiont >= 0 && t < n_classes
failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [416,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [417,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [288,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [289,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [8,0,0], thread: [64,0,0] Assertion `t >= 0 && t < n_classes` failed.
from transunet.
首先,感谢您的贡献。我以前向您发送过一封电子邮件,还下载了您的数据集。我想看看你原来的数据图像,所以我写了一个程序来打开你的NPY数据,但我得到的图像是全黑的,打印也显示0为mdarray。请问怎么了?
此外,如果我想训练自己的数据集,在创建数据集时有什么我应该注意的吗?
Hello! Cound you please send the preprocessed data set that can run the code to my mailbox? Thank you! [email protected]
from transunet.
@qdzwss Hello! Cound you please send the preprocessed data set that can run the code to my mailbox? Thank you![email protected]
from transunet.
Hi,many thanks you for your answer.
- I used np.sum() to find that the value of the data is not 0. This is my mistake
- I have prepared my own 2D single channel bacterial data set with the size of 512*512. What I want to do is binary classification problem. Like your data, I converted the PNG file to NPZ file and modified the train.txt (in list_Synapse) and put them into the correct path.Here's where I changed the code:
1.See './train.py' line 33-------->default=512
2.See './train.py' line 62-------->'num_classes': 2,
3.See './trainer.py' line 36-------->num_workers=1but i got the error:
(I think the reason is : nn.CrossEntropyLoss(input, target):The number of columns in input and target do not match
But I haven't found out how to change it so far. Could you help me?Thank you very much)``load_pretrained: grid-size from 14 to 32
Namespace(base_lr=0.01, batch_size=5, dataset='Synapse', deterministic=1, exp='TU_Synapse512', img_size=512, is_pretrain=True, list_dir='./lists/lists_Synapse', max_epochs=50, max_iterations=30000, n_gpu=1, n_skip=3, num_classes=2, root_path='../data/Synapse/train_npz', seed=1234, vit_name='R50-ViT-B_16', vit_patches_size=16)
The length of train set is: 200
40 iterations per epoch. 2000 max iterations
0%| | 0/50 [00:00<?, ?it/s]/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [9,0,0], thread: [256,0,0] Assertiont >= 0 && t < n_classes
failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [416,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [417,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [288,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [4,0,0], thread: [289,0,0] Assertion `t >= 0 && t < n_classes` failed.
/pytorch/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [8,0,0], thread: [64,0,0] Assertion `t >= 0 && t < n_classes` failed.
hello there, have you solved the problem?
from transunet.
Hello! Cound you please send the preprocessed data set that can run the code to my mailbox? Thank you! [email protected]
from transunet.
First of all, thank you for your contribution.I sent an email to you before and also downloaded your data set. I wanted to see your original data image, so I wrote a program to open your NPY data, but the image I got was all black, and the print also displayed 0 for the mdarray.What is the matter, please?
Also, if I want to train my own data set, is there anything I should pay attention to when creating it?
Hello, I am sorry to bother you, can you send me the processed data, my email is [email protected]
from transunet.
Hello! Cound you please send the preprocessed data set that can run the code to my mailbox? Thank you! [email protected]
Could you be so kind to share the processed data? Looking forward to your reply. My email is [[email protected]]
from transunet.
First of all, thank you for your contribution.I sent an email to you before and also downloaded your data set. I wanted to see your original data image, so I wrote a program to open your NPY data, but the image I got was all black, and the print also displayed 0 for the mdarray.What is the matter, please?
Also, if I want to train my own data set, is there anything I should pay attention to when creating it?Hello, I am sorry to bother you, can you send me the processed data, my email is [email protected]
Could you be so kind to share the processed data? Looking forward to your reply. My email is [email protected].
from transunet.
First of all, thank you for your contribution.I sent an email to you before and also downloaded your data set. I wanted to see your original data image, so I wrote a program to open your NPY data, but the image I got was all black, and the print also displayed 0 for the mdarray.What is the matter, please?
Also, if I want to train my own data set, is there anything I should pay attention to when creating it?
Could you be so kind to share the processed data? Looking forward to your reply. My email is [email protected].
from transunet.
Related Issues (20)
- Different input size (width x height)
- Reason for [-125, 275] input clipping
- "ZeroDivisionError: integer division or modulo by zero" when vit_patches_size=8 HOT 3
- Need R50+ViT-B_16 rather than R50-ViT-B_16!
- 当我在运行TransUNet-main的train.py时出现错误:KeyError: 'Transformer/encoderblock_0/Multi5HeadDotProductAttention_1/query/kernel is not a file in the archive' 这是在我进行KeyError: 'Transformer/encoderblock_0/MultiHeadDotProductAttention_1/query\\kernel is not a file in the archive'后的更改出现的错误,csdn说这是os.path.join 合并路径的时候出现的问题,更改后仍然出现以上错误 HOT 3
- Even if we fix the seed, the results change for each training.
- asking for you help
- ACDC dataset 100 cases of data
- Training for three-channel dataset
- Need R50+ViT-L_16 pretrained model rather than R50+ViT-L_32 HOT 1
- 导入包报错,文件夹重名导致的坑 HOT 2
- Data preprocessing HOT 2
- Training with different image size HOT 1
- Is the Synapse multi-organ segmentation dataset experimental result obtained from is the 20 samples official test set?
- change patch_size during test
- PreActBottleneck
- Training performance issues on small-sized targets
- The issue arises from the absence of the "lists_Synapse" folder.
- ACDC dataset
- About the solution of problems like "have 3 channels, but got 1000 channels instead"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transunet.