Comments (15)
Following is the list of npm package and version I'm using.
$ yarn list --pattern tensorflow
yarn list v1.22.19
├─ @tensorflow-models/[email protected]
├─ @tensorflow/[email protected]
├─ @tensorflow/[email protected]
├─ @tensorflow/[email protected]
├─ @tensorflow/[email protected]
├─ @tensorflow/[email protected]
├─ @tensorflow/[email protected]
├─ @tensorflow/[email protected]
└─ @tensorflow/[email protected]
- OS: macOS (Sonoma 14.4.1)
- Browser: Chrome (Version 123.0.6312.107 (Official Build) (x86_64))
import { SupportedModels, movenet, createDetector } from '@tensorflow-models/pose-detection';
createDetector(SupportedModels.MoveNet, {
modelType: movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: 'https://xxxx.my.own.domain.space/mymodelfolder/model.json'
})
After uploading the model files to my own storage, specifying its url makes it work. However, do I REALLY have to serve the model files myself? 😬
from tfjs.
You will have to disable cors in chrome
Go to the directory where chrome.exe file is located and open command prompt there
and paste
chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security
this will open chrome window with disabled cors. Now run your model on this chrome window.
from tfjs.
Hello, same here. The temporary solution from @ryan-cha work well TY, you can try with with my storage if needed:
createDetector(SupportedModels.MoveNet, {
modelType: movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: 'https://www.posetracker.com/scripts/tmp_model_to_remove.json'
})
from tfjs.
Hi, All
I apologize for the delayed response and thank you for bringing this issue to our attention and @ryan-cha thanks a lot for your workaround, I was trying to replicate the same issue from my end with official tensorflow demos and with below code snippet but I'm unable to replicate the same issue now from my end or Am I missing something here, if so please let me know ?
Could you please give it try from your end now and let us know is it working as expected or not ? if issue still persists please let us know with code snippet and error log to investigate this issue further from our end ?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TensorFlow.js Movenet model testing</title>
</head>
<body>
<!-- Require the peer dependencies of pose-detection. -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter"></script>
<!-- You must explicitly require a TF.js backend if you're not using the TF.js union bundle. -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl"></script>
<!-- Alternatively you can use the WASM backend: <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/pose-detection"></script>
<script>
// Replace with your actual TensorFlow.js code
async function main() {
await tf.setBackend("webgl");
await tf.ready();
const detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
};
const detector = await poseDetection.createDetector(
poseDetection.SupportedModels.MoveNet,
detectorConfig
);
console.log(detector);
}
main(); // Call the main function to start execution
</script>
</body>
</html>
Output of above index.html
file :
Thank you for your cooperation and patience.
from tfjs.
@teje87 I'm using Movenet thunder and it's here.
Find the download button and download the whole files using "download as tar.gz".
Extract it and put all the files at the same level, and point "model.json". Then, the other files should be loaded accordingly.
from tfjs.
Thanks @ryan-cha your solution made it work
from tfjs.
@gaikwadrahul8
I tried your html file and my production code as well and, it seems that we all had a real bad dream last night. 😂
Now it's working ok as you observed, meaning the issue is gone.
Lessons learned:
- The model files THEY serve can be unreachable from time to time. (There are posts about this cors issue even from the past)
- If it happens, I should persuade my clients/boss to hold a bit, not knowing when it'll be fixed. 🤷♂️
Conclusion:
- For customer-facing or critical projects, I'd rather serve model files myself for the peace in my mind.
from tfjs.
same here
from tfjs.
@momomuchu I am stuck in the same situation, did you manage to make it work ?
from tfjs.
Can't ask a user to disable do I? That's not a solution @vansh-agg
from tfjs.
I'm facing the same error. Can't make it work even using my own model.json, maybe I'm using the wrong one. @ryan-cha Where did you download the model from?
from tfjs.
I was using a wrong model version downloaded from kaggle. The temporary solution @ryan-cha proposed is working for me.
from tfjs.
Hi, @ryan-cha
Thank you for the confirmation and I'm glad to hear the issue seems to be resolved and your code is working as expected now! Thanks for sharing your experience and insights. It's definitely a good point that external model files can be subject to occasional unavailability for some time due to various factors but now things are working as expected.
Hi, @abhishekvasu94
I'd appreciate it if you could verify on your end that everything is functioning as intended. If so, please feel free to close this issue now.
Thank you for your cooperation and patience.
from tfjs.
Thanks @gaikwadrahul8. I can confirm it works. Closing this issue
from tfjs.
Are you satisfied with the resolution of your issue?
Yes
No
from tfjs.
Related Issues (20)
- Question: is the Windows tensorflow binary / dll used in tfjs-node compiled with support for zenDNN optimisations? HOT 2
- Standard layers (like `tf.layers.dense`) fail to report their trainable weights, when used from within a custom layer HOT 4
- Error installing @tensorflow/tfjs-node at WSL Ubuntu HOT 3
- Bug when stacking LSTM HOT 4
- Tensor construction fails for the majority of TypedArray types HOT 1
- Trouble loading a saved model in tfjs-node, "Op type not registered 'DisableCopyOnRead'" HOT 3
- tfjs-node - upgrade tar >=6.2.1 HOT 3
- Undefined variable tensorflow-library-target in binding.gyp HOT 4
- tensorflowjs_converter: NotImplementedError: numpy() is only available when eager execution is enabled HOT 9
- tensorflowjs_converter on .keras file messes up weights HOT 6
- Safari webworker `Error when getting WebGL Context` HOT 4
- tfjs-node-gpu warnings (not running in GPU mode) HOT 2
- Model with softmax output layer not outputing probabilities but just 1 and 0 HOT 4
- Model Face Detection Confidence Score Output or Minimum Confidence Score Threshold
- model.executeAsync fails when loading multiple converted TF-DF models HOT 4
- TensorFlowJS fails reliably on Intel GPU running Windows, otherwise succeeds HOT 1
- Error when a module try to install tensorflow HOT 4
- I can't install @tensorflow/tfjs-node in my project HOT 5
- Finish placeholder features: einsum gradients, conv1d causal padding HOT 3
- Tfjs pose detection not working with newer Android devices (12, 13, 14) HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tfjs.