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

[Bug]: I use the same model, windos and linux generate completely different vectors #1044

Closed
1 task done
emmataobao opened this issue Apr 8, 2022 · 5 comments
Closed
1 task done
Labels
kind/bug Issues or changes related a bug

Comments

@emmataobao
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

model towhee/image-embedding-regnetx-016
path photo/202008/13/mapp202008130105517751.jpg
Windows 10 python 3.9 towhee 0.5.1
vector
centos 7 python 3.7 towhee 0.5.1

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- Towhee version(e.g. v0.1.3 or 8b23a93):
- OS(Ubuntu or CentOS):
- CPU/Memory:
- GPU:
- Others:

Anything else?

No response

@emmataobao
Copy link
Author

image (1)
image

@binbinlv binbinlv added the kind/bug Issues or changes related a bug label Apr 8, 2022
@binbinlv
Copy link
Contributor

binbinlv commented Apr 8, 2022

Actually, I found the difference is at the last bits of each element, for example:
"0.021529437974095345" and "0.0215294249355793", " it is the same with the previous 7 bits "0.0215294", and the remaining is different.

I think this may be the difference between different OS and different python version.

@filip-halt Could you help to have a look too? Thanks.

@jaelgu
Copy link
Contributor

jaelgu commented Apr 8, 2022

@emmataobao Can you check what is your output dtype? I've checked this pipeline and its output has dtype=float32. But according to your results, it looks like your dtype is about float64. If so, then the extra floats expanded are not precise.

@fzliu
Copy link
Member

fzliu commented Apr 8, 2022

The results that you see are normal and are a result of inaccuracies in floating point math. Do you need the vectors to be entirely identical between the two? If you want to check for equality, you should be able to use numpy.isclose.

@emmataobao
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug
Projects
None yet
Development

No branches or pull requests

5 participants