Skip to content
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

Angular 14 ng production build gives "the tensor should have 409600 values but has 5803" #875

Open
bbright-dinesh opened this issue Aug 4, 2024 · 6 comments

Comments

@bbright-dinesh
Copy link

bbright-dinesh commented Aug 4, 2024

When I try to run the angular 14 in debug build, I am able to scan the image and getting the proper image properties.

But, When I run in production build, We are getting the above error while parsing image.
Is there any different between prod/debug build ???

Kindly let us know.

We are using mobilnet_v2 for scanning the images.

Here is the full error message.

Based on the provided shape, [1,1,320,1280], the tensor should have 409600 values but has 5803

@bbright-dinesh
Copy link
Author

Any help here please

@GantMan
Copy link
Member

GantMan commented Aug 9, 2024

That's an interesting error. I'm not familiar with any bug that should cause that :/

@bbright-dinesh
Copy link
Author

Thank you @GantMan for responding.

There are no errors at all, when the build is in Debug mode, but it's the error only we are facing in the release mode.
It would be great someone to shed some light into this. Or let me know if any pointers to debug this case.

Thank you.

@GantMan
Copy link
Member

GantMan commented Aug 12, 2024

You might want to check into the TensorFlow flags

https://www.tensorflow.org/js/guide/platform_environment#flags
&
https://github.com/infinitered/nsfwjs/tree/5ce2a0863db5e20c19cbe901b3454c8a7c16918a?tab=readme-ov-file#production

I don't know what could be changing because these are manual flags, though.

@bbright-dinesh
Copy link
Author

Thank you @GantMan for the directions.

Let me look into this and see why the release mode behaving a little different.

@ambrt
Copy link

ambrt commented Oct 15, 2024

I think i had similar error when one of files was wrongly encoded (json stringified instead of being a buffer). So basically somewhere in your production env you lose proper file (~400K) and something else is served to TF (~5K).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants