GithubHelp home page GithubHelp logo

Questions about your data about transunet HOT 10 OPEN

qdzwss avatar qdzwss commented on June 14, 2024 1
Questions about your data

from transunet.

Comments (10)

Beckschen avatar Beckschen commented on June 14, 2024

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.

  1. 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.

qdzwss avatar qdzwss commented on June 14, 2024

Hi,many thanks you for your answer.

  1. I used np.sum() to find that the value of the data is not 0. This is my mistake
  2. 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] 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: [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.

minhoooo1 avatar minhoooo1 commented on June 14, 2024

首先,感谢您的贡献。我以前向您发送过一封电子邮件,还下载了您的数据集。我想看看你原来的数据图像,所以我写了一个程序来打开你的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.

fmd233 avatar fmd233 commented on June 14, 2024

@qdzwss Hello! Cound you please send the preprocessed data set that can run the code to my mailbox? Thank you![email protected]

from transunet.

nothingtosay-l avatar nothingtosay-l commented on June 14, 2024

Hi,many thanks you for your answer.

  1. I used np.sum() to find that the value of the data is not 0. This is my mistake
  2. 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] 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: [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.

hyunwoo137 avatar hyunwoo137 commented on June 14, 2024

Hello! Cound you please send the preprocessed data set that can run the code to my mailbox? Thank you! [email protected]

from transunet.

ssli23 avatar ssli23 commented on June 14, 2024

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.

AXu0511 avatar AXu0511 commented on June 14, 2024

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.

AXu0511 avatar AXu0511 commented on June 14, 2024

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.

AXu0511 avatar AXu0511 commented on June 14, 2024

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)

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.