You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using 'I;16' images to train my network and got the following error. Input type (Short) and weight type (Float) should be the same
And I was wondering if 'I' and 'I;16' PIL image modes should also be converted into FloatTensor when we apply ToTensor() transform to the image.
I am sorry if this was intended.
I thought this was weird because, in to_tensor() method, every PIL image mode except 'I', and 'I;16' gets converted into FloatTensor.
transform.py
from 78: return img
to 78: return img.float()
Thank you in advance for your time! :)
The text was updated successfully, but these errors were encountered:
support for I and I;16 in the ToTensor transform was added in this PR, the use case was for things like MRI images, where conversion from an int32 image to a float32 representation causes information to be lost. It's also important to note that calling ToTensor on I or I;16 images will also do no rescaling of the range of the images.
one work around, if you want float images is to explicitly call .float on the response, or convert your images after conversion to a pil image. These operations can also be made as a transform inside your Compose
Hello there,
I was using 'I;16' images to train my network and got the following error.
Input type (Short) and weight type (Float) should be the same
And I was wondering if 'I' and 'I;16' PIL image modes should also be converted into FloatTensor when we apply ToTensor() transform to the image.
I am sorry if this was intended.
I thought this was weird because, in to_tensor() method, every PIL image mode except 'I', and 'I;16' gets converted into FloatTensor.
transform.py
from
78: return img
to
78: return img.float()
Thank you in advance for your time! :)
The text was updated successfully, but these errors were encountered: