tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.51k stars 1.94k forks source link

face-landmarks-detection dependency conflict #7905

Open aptxyz opened 1 year ago

aptxyz commented 1 year ago

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

Describe the problem

npm install @tensorflow-models/face-landmarks-detection

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: @tensorflow/tfjs-backend-webgl@4.10.0 npm ERR! node_modules/@tensorflow/tfjs-backend-webgl npm ERR! peer @tensorflow/tfjs-backend-webgl@"^4.4.0" from @tensorflow-models/face-detection@1.0.2 npm ERR! node_modules/@tensorflow-models/face-detection npm ERR! @tensorflow-models/face-detection@"^1.0.1" from the root project npm ERR! peer @tensorflow-models/face-detection@"~1.0.0" from @tensorflow-models/face-landmarks-detection@1.0.5 npm ERR! node_modules/@tensorflow-models/face-landmarks-detection npm ERR! @tensorflow-models/face-landmarks-detection@"" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @tensorflow/tfjs-backend-webgl@"^3.12.0" from @tensorflow-models/face-landmarks-detection@1.0.5 npm ERR! node_modules/@tensorflow-models/face-landmarks-detection npm ERR! @tensorflow-models/face-landmarks-detection@"" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! C:\Users\User\AppData\Local\npm-cache_logs\2023-08-13T02_50_36_950Z-eresolve-report.txt

image

dependency conflict, the face landmarks detection model use tfjs v3, however the model 'face-detection@1.0.2' update tfjs from v3 to v4

gaikwadrahul8 commented 1 year ago

Hi, @aptxyz

Apologize for the delayed response and thank you for bringing this issue to our attention, I checked @tensorflow-models/face-landmarks-detection and it's using this version "^3.12.0" and for this package @tensorflow-models/face-detection@1.0.2 it's using "^4.4.0"

Could you please try to use this package version @tensorflow-models/face-detection@1.0.1 where it's using this version "^3.14.0" and let us know whether is it working as expected or not ?

We'll dig more into this issue with dependancies conflict and if possible we'll try to update package dependancies for @tensorflow-models/face-landmarks-detection to V4 because it's using the V3 package versions at the moment. Thank you!

aptxyz commented 1 year ago

I think I did tried install all three together face-detection@1.0.1 along with tfjs@3 & face-landmarks-detection@1.0.2 without warning, and it's working as expected. But I eventually just download models from tfhub and use tfjs@4 as backend for various reasons.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No

JacobRMiller commented 1 year ago

I'm running into the same issue. I also tried face-detection@1.0.1 along with tfjs@3and face-landmarks-detection@1.0.2 without success.

github-actions[bot] commented 1 year ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 1 year ago

This issue was closed due to lack of activity after being marked stale for past 7 days.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No

iamsolankiamit commented 10 months ago

Hey was anyone able to resolve this issue?

Johnrobmiller commented 7 months ago

This was never resolved. A maintainer ought to fix this!

maazcloudhire commented 3 months ago

Can someone please fix this?

maazcloudhire commented 3 months ago

I did --legacy-peer-deps. but now It's creating an issue in production.

klimeryk commented 2 months ago

Can confirm the issue still exists. Can't even run the demos from the official repository.

mattsoulanille commented 1 month ago

This should now be fixed as of face-landmarks-detection 1.0.6, and it should no longer request version 3 and 4 of TFJS at the same time. I'll reopen this for now until I get confirmation that the fix works for your project.

klimeryk commented 1 month ago

@mattsoulanille, thank you so much for the follow-up! I've tested on a branch for my project and can confirm that the dependency conflict has been resolved 🎉 So this issue can be closed 🙇 However, for my use case, the library still cannot be used in production due to https://github.com/tensorflow/tfjs/issues/8290. Looks like this model (maybe others?) are not compatible with https://vitejs.dev/ It would be hugely helpful if you could have a look if there's anything that can be done to fix that situation 🙏 I'll leave some notes there on my findings so far.