New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images being used with .predict() don't appear to be normalized the same way as the images pulled using get_x from the datasets (for feeding into predict_array). #535
Comments
nwertzberger
changed the title
Images being used with .predict() don't appear to be normalized.
Images being used with .predict() don't appear to be normalized the same way as the images pulled using get_x from the datasets (for feeding into predict_array).
Jun 4, 2018
You should never call |
Is it intentional that the resulting tensor is not normalized between 0 and
1?
…On Wed, Jun 6, 2018 at 3:12 PM Jeremy Howard ***@***.***> wrote:
You should never call get_x directly. Instead just use the standard
dataset indexer: dataset.val_ds[i]
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#535 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAV_m2qo2WER1Y4UBKjpr7bTQRNr3hFwks5t6DfJgaJpZM4UX3Y0>
.
|
Here is the answer to your question
https://discuss.pytorch.org/t/whats-the-range-of-the-input-value-desired-to-use-pretrained-resnet152-and-vgg19/1683
On Wed, Jun 6, 2018 at 1:53 PM, Nick Wertzberger <notifications@github.com>
wrote:
… Is it intentional that the resulting tensor is not normalized between 0 and
1?
On Wed, Jun 6, 2018 at 3:12 PM Jeremy Howard ***@***.***>
wrote:
> You should never call get_x directly. Instead just use the standard
> dataset indexer: dataset.val_ds[i]
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#535 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAV_
m2qo2WER1Y4UBKjpr7bTQRNr3hFwks5t6DfJgaJpZM4UX3Y0>
> .
>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#535 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC3CZSrApH80DGGkqt8jiZHnl5GWEBf_ks5t6EFCgaJpZM4UX3Y0>
.
|
I’m sorry, I am not quite understanding the answer here. In one interface,
I see the images are normalized from 0 to 1, and that makes sense. I expect
to see normalized images as mentioned In Torchvision. On the iterator
interface, I see tensors that do not appear to be normalized. Also, when I
give a normalized image to my network, it gives significantly different
predictions than my non normalized input, making me think that nothing is
auto-normalizing the input, at least through predict_array.
…On Wed, Jun 6, 2018 at 4:05 PM Yannet ***@***.***> wrote:
Here is the answer to your question
https://discuss.pytorch.org/t/whats-the-range-of-the-input-value-desired-to-use-pretrained-resnet152-and-vgg19/1683
On Wed, Jun 6, 2018 at 1:53 PM, Nick Wertzberger ***@***.***
>
wrote:
> Is it intentional that the resulting tensor is not normalized between 0
and
> 1?
> On Wed, Jun 6, 2018 at 3:12 PM Jeremy Howard ***@***.***>
> wrote:
>
> > You should never call get_x directly. Instead just use the standard
> > dataset indexer: dataset.val_ds[i]
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub
> > <#535 (comment)>,
> or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/AAV_
> m2qo2WER1Y4UBKjpr7bTQRNr3hFwks5t6DfJgaJpZM4UX3Y0>
> > .
> >
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#535 (comment)>,
or mute
> the thread
> <
https://github.com/notifications/unsubscribe-auth/AC3CZSrApH80DGGkqt8jiZHnl5GWEBf_ks5t6EFCgaJpZM4UX3Y0
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#535 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAV_mzDoF4iqg_xWDOY0f2i_0Y2zvry1ks5t6EQTgaJpZM4UX3Y0>
.
|
jph00
pushed a commit
that referenced
this issue
Aug 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I've been trying to track down why I get a different answer for:
vs what i see in preds from running (learner.predict()) using the same dataset. I noticed the following:
When I look up predict_with_targs, it seems that it turns the dataloader into an iterator, and then shoves those values into the model via this:
When I pull out some data using this method, I notice that the resulting tensor is NOT normalized, but the dimensions are 3x128x128 (what my model expects):
When I pull from the dataset using get_x, it IS normalized, but the dimensions are 128x128x3
Given that the other interfaces return normalized images, i think this might not be on purpose, but I'm no expert on what should or should not be normalized. I know that it not being normalized makes lime integration difficult, and, because the dimensions of the images pulled in each case is different, I have to transpose them as well, which seems awkward.
The text was updated successfully, but these errors were encountered: