glow-pytorch icon indicating copy to clipboard operation
glow-pytorch copied to clipboard

Change image_size to 256

Open viettmab opened this issue 3 years ago • 7 comments

Hi, I want to change image_size to 256. Do I need to change the value of n_bits and n_bins? Another question I want to ask is the meaning of the code from lines 111 to 116 in https://github.com/rosinality/glow-pytorch/blob/master/train.py#L111 Thank you Viet Nguyen

viettmab avatar Nov 01 '21 03:11 viettmab

In the paper authors used 5 bits for 256px. And image * 255 is to rescale value ranges for args.n_bits < 8, as image is in [0, 1].

rosinality avatar Nov 01 '21 12:11 rosinality

In the https://github.com/rosinality/glow-pytorch/blob/master/train.py, After line 109 image is in [0,1]. After line 111 image is in [0,255]. After line 114 image is in [0,31.875]. After line 116, image is in [-0.5,0.5]. Am I right? Why don't we just change from [0,1] to [-0.5,0.5] directly?

viettmab avatar Nov 01 '21 14:11 viettmab

No, it is different as it is multiplied with 255 (not 256) and floor is applied.

rosinality avatar Nov 02 '21 11:11 rosinality

Okay, I understand. So I change the image_size to 256 instead of 64 so that the image size becomes (3,256,256). Do I need to change any value, e.g n_bits,..?

viettmab avatar Nov 02 '21 13:11 viettmab

I think it is safe to use the settings in the paper. (5 bits)

rosinality avatar Nov 03 '21 14:11 rosinality

Yeah, thank you very much!

viettmab avatar Nov 03 '21 17:11 viettmab

Hi, when I change the image_size to 256 instead of 64 so that the image size becomes (3,256,256), some errors occured, can you share your code?

Moleculebo avatar Mar 04 '23 09:03 Moleculebo