pytorch-CycleGAN-and-pix2pix
pytorch-CycleGAN-and-pix2pix copied to clipboard
pix2pix using grayscale image with 16-bit signed integer pixel values
I am trying to use single layer images that have intensity range from -1024 to 3072 (12 bit, signed). I have changed the aligned_dataset.py so that I can read my images into numpy arrays and then convert them into PIL Images. The change I made in the code is as follows:
if ".hdf5" in AB_path: AB = sitk.ReadImage(AB_path) AB = Image.fromarray(sitk.GetArrayFromImage(AB) else: AB = Image.open(AB_path).convert('RGB')
The rest is the same and all images are 256x256. When I try to run the following command:
$python train.py --dataroot ./datasets/data_path --model pix2pix --gpu_ids 0 --direction AtoB --input_nc 1 --output_nc 1 --n_epochs 100
I get following response:
Setting up a new session...
create web directory ./checkpoints/experiment_name/web...
/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/optim/lr_scheduler.py:123: UserWarning: Detected call of lr_scheduler.step()
before optimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step()
before lr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
"https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
learning rate 0.0002000 -> 0.0002000
Traceback (most recent call last):
File "train.py", line 46, in
What is wrong?
Hello, I have also encountered this problem. May I ask how you solved this problem?