Closed PyoJunCode closed 1 year ago
Could you please print the maximum value of clean before line 587 to verify your intuition whether tranforms.ToTensor() has transformed clean into the range [0.0.1.0].
I double checked my code,
I found that ToTensor()
code change the range in to [0.0, 1.0] if input type is not float
That happened because I opened image with cv2.imread
and deleted im = np.array(im, dtype=np.float32)
, so the input type was uint8.
Sorry for confusion, and thank you for fast comment. I'm gonna close this issue.
In
train_b2u.py
, train logic usingDataLoader_Imagenet_val
class. I think there is issue about scaling image value range.At line 363-364
im
transformed into range [0.0, 1.0] bytransforms.ToTensor()
.But in train loop (line 587), img devided by 255 again.
Is it intended or not?
I don't know it's related to this issue, my trained model outputs gray-scale image when using naive code.