-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Hello, when I trained the model with my own dataset(MRI slices) about 1000 npy files, I encountered the problem above. According to your updated code, I transformed my npy files to PIL images , the detailed code is as follows:
`def npy_to_pil(file):
np_array=np.load(file)
np_img=normalize_data(np_array)#0-255
np_img=np_img.round().astype('uint8')
pil_images=Image.fromarray(np_img.squeeze(0),mode='L')
return pil_images
def normalize_data(data):
min=data.min()
max=data.max()
data=(data-min)/(max-min)*255.0
return data`
And my settings are as follows:
CUDA_VISIBLE_DEVICES={DEVICES} python3 main.py
--mode train
--model_type DDPM
--img_size 256
--num_img_channels 1
--dataset {DATASET_NAME}
--train_batch_size 8
--eval_batch_size 8
--eval_sample_size 1000
--segmentation_guided
Here are my results and mask used:
I have some guesses:
First is the number of my dataset. Is it possible that the number of my dataset is too small?
Second is the type of my dataset. My dataset is MRI, is MRI training difficultly? Because MRI is little more comlex compared to CT. Should I train my dataset with more epochs?
Third is the range of the data. When I trained my dataset with the code at first for 400 epochs, the range of my data is [-1,1 ], the trained result is as follows:
It looks worse than the PIL image. So does the range of data have bad influence on the result at the same epochs? If I use [-1,1] data range, I trained the model with more epochs, will the influence vanish and generate images with no noises?
Hope to get your response.