Some questions about testing~
Hello author, I was thinking about changing the model mode to test when running the test, but an error occurred:‘ no module name models.test_model’, I also encountered the same error when replacing dataset_made unaligned to single. What is the reason for this? Looking forward to your reply very much.
Hi @zky0701. Are you using the test.py file?
Hi @zky0701. Are you using the test.py file?
Thank you for your reply. Yes, I am using test. py. Strangely, when I run the test. py file, the files under the val_A and val_B files are also read and tested, not just the test_A and test_B. Is this normal? Or what part do you want to modify?
The dataset part is handle mostly by the script "unaligned_dataset.py". Try to keep using it. Specifically, where did you get the error "...models.test_model..."? There is not any function or package "test_model" in the repo. Could you provide a screenshot or more information?
The dataset part is handle mostly by the script "unaligned_dataset.py". Try to keep using it. Specifically, where did you get the error "...models.test_model..."? There is not any function or package "test_model" in the repo. Could you provide a screenshot or more information?
When I change -- model to test and -- dataset_mode to single, there is an error as shown in the figure. We look forward to your reply.
Hi @zky0701. Please, use --model mask_gan and --dataset_mode unaligned. There is not a model "test". About the datataset_mode, we set everything based on the unaligned script.
Hi @zky0701. Please, use --model mask_gan and --dataset_mode unaligned. There is not a model "test". About the datataset_mode, we set everything based on the unaligned script.
Okay,thanks a lot!
Hi @zky0701. Please, use --model mask_gan and --dataset_mode unaligned. There is not a model "test". About the datataset_mode, we set everything based on the unaligned script.
Sorry to bother you again, author. I have another question. Why is there data in the valA and valB folders instead of just the data in the test folder in the test_desult I obtained while running test.xpy? The arrangement of my folder directory is as follows. May I ask if there are any implicit calls to the test. py file?
The valA and valB folders are used just for validation during the training process (to check how the model goes during the training)
The valA and valB folders are used just for validation during the training process (to check how the model goes during the training)
Thank you for taking the time to answer, but I have one more question. When I was running test. py, I set the parameters image_2 to 256 * 256 and pre-processing to none. However, when I checked the results, I found that the size of my image had been changed to 224 * 224. May I ask what caused this problem? What hyperparameter settings are related to modifying the image size during the test phase? I am looking forward to your answer!
Hi @zky0701, by the way, have you checked the preprocess script? The next function is available in https://github.com/HieuPhan33/MaskGAN/blob/master/preprocess/main.pyin the line 152. Here, we are resizing images to 214, 214, 214, but adding also a padding. In that way we can get the input images with size 224, 224, 224. You can modify this as your convenience.
def save_slice(img, mask, data_dir, data_mask_dir, filename): assert img.shape == mask.shape, f"Shape not match - img {img.shape} vs mask {mask.shape}" pad_width = ((5, 5), (5, 5), (5, 5)) # Resize to 204,204,204 img = resize_volume(img, 214,214,214) img = np.pad(img, pad_width, mode='constant', constant_values=0) mask = resize_volume(mask, 214,214,214) mask = np.pad(mask, pad_width, mode='constant', constant_values=0)
Thank you for your reply.Yes, I have reviewed all the code in the main. py file during preprocessing and obtained the desired image size. However, when I ran test. py and set the --preprocess parameter to none, the size of the test result was changed. Is this related to the code in line 152 of preprocessing that you mentioned?
In our repo, the preprocessing is done in two stages.
Firstly, in order to align images in a general way you need to run the script: https://github.com/HieuPhan33/MaskGAN/blob/master/preprocess/main.py. In that way, you go to create the input folders (train, val, test) and set the images in a "generic" format.
Secondly, during training a new preprocessing could be carried out. Here, you can resize, pad and crop the image to a different format if you need. This is process controlled by the argument "--preprocess" when you are training or testing. So, even if you set "--preprocess none", this doesn't affect the preprocessing in the first stage.
In our repo, the preprocessing is done in two stages.
Firstly, in order to align images in a general way you need to run the script: https://github.com/HieuPhan33/MaskGAN/blob/master/preprocess/main.py. In that way, you go to create the input folders (train, val, test) and set the images in a "generic" format.
Secondly, during training a new preprocessing could be carried out. Here, you can resize, pad and crop the image to a different format if you need. This is process controlled by the argument "--preprocess" when you are training or testing. So, even if you set "--preprocess none", this doesn't affect the preprocessing in the first stage.
Thank you very much for your quick response, I will try it out based on your answer, thank you again!