himashi92 / vizviva_brats_2021

[Brainlesion 2021] Official PyTorch Implementation for Reciprocal Adversarial Learning for Brain Tumor Segmentation: A Solution to BraTS Challenge 2021 Segmentation Task
MIT License
20 stars 3 forks source link

test.py #3

Closed H-CODE6 closed 2 years ago

H-CODE6 commented 2 years ago

Hello, I didn't find test.py in the code folder , can you provide it?

himashi92 commented 2 years ago

Added test.py to the repository.

H-CODE6 commented 2 years ago

Thank you for your reply. I can't run train.py successfully according to your command python train.py --num_classes 3 --epochs 350 , is there any change in the running code? Or do you need to change the code in the train.py?

himashi92 commented 2 years ago

What is the error you are getting?

H-CODE6 commented 2 years ago

usage: train.py [-h] [-a ARCH] [--width WIDTH] [-j N] [--start-epoch N] [--epochs N] [-b N] [--lr LR] [--lr_dis LR_DIS] [--wd W] [--resume PATH] [--devices DEVICES] [--seed SEED] [--warmup N] [--disable-cos] [--warm WARM] [--val VAL] [--fold FOLD] [--norm_layer NORM_LAYER] [--optim {adam,sgd,adamw}] [--com COM] [--dropout DROPOUT] [--warm_restart] [--full] [--lambda_adv LAMBDA_ADV] [--lambda_vat LAMBDA_VAT] train.py: error: unrecognized arguments: --num_classes 3 Do you need to make changes to run the code?

himashi92 commented 2 years ago

Try the latest code without the argument num_classes.

H-CODE6 commented 2 years ago

NameError: name 'KFold' is not defined after operation,The code in train.py should need to be updated

H-CODE6 commented 2 years ago

The code in brats.py and train.py should need to be updated

himashi92 commented 2 years ago

I updated the repo. Can you check now?

H-CODE6 commented 2 years ago

The training code should be available. Thank you very much for your answer. If you continue to have questions, please ask you again? Thank you again.

H-CODE6 commented 2 years ago

Hello, the author. I'm running your code. I put 770 data in the training process. During the training process, I found that it was divided into two parts. There was a separate copy of more than 70 data. I started training after running several epochs. How do you understand this? Why divide according to such proportion?

himashi92 commented 2 years ago

I splitted dataset into training and validation datasets. Validation dataset is used to evaluate model's performance over unseen data during training. Based on performance, I save the best model.

Please follow Kfold function https://github.com/himashi92/vizviva_brats_2021/blob/main/dataset/brats_train.py#L96.

H-CODE6 commented 2 years ago

OK, why is the training set split? Can't the valid verification set be directly used to test the performance?

himashi92 commented 2 years ago

Ground truth masks for the validation dataset are not yet released. You can use the BraTS continuous evaluation portal to evaluate your predictions on the BraTS 2021 validation dataset.

H-CODE6 commented 2 years ago

OK, can you provide me with the address of the brats evaluation website?

himashi92 commented 2 years ago

https://www.synapse.org/#!Synapse:syn27046444/wiki/616991

H-CODE6 commented 2 years ago

Hello, just run test Py, the error of AttributeError: 'Namespace' object has no attribute 'lambda_adv' appears. What is the reason?

H-CODE6 commented 2 years ago

After adding parser.add_argument('--lambda_adv', type=float, default=0.3, help='scalar constant adversarial loss') parser.add_argument('--lambda_vat', type=float, default=0.2, help='scalar constant vat loss'),The error also appears RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK/Code/IO/src/sitkImageReaderBase.cxx:99: sitk::ERROR: The file "/media/hkw/hkwdisk/vizviva_brats_2021-main/BRATS2021/Data/valid/BraTS2021_00011t1.nii.gz" does not exist. There should be brats2021 after valid 00011 this question folder Can you update test.py code

himashi92 commented 2 years ago

This test.py code is written according to the brats evaluation. You can modify it in the way you want.