victordibia / handtrack.js

A library for prototyping realtime hand detection (bounding box), directly in the browser.
https://victordibia.com/handtrack.js/
MIT License
2.83k stars 250 forks source link

Cannot read property 'node' of undefined #43

Open jonasholfeld opened 3 years ago

jonasholfeld commented 3 years ago

I have 2 different Vue projects wich both use handtrackjs. The components which use handtrackjs are identical. In the newer project i get the following error:

Uncaught (in promise) TypeError: Cannot read property 'node' of undefined at e.evaluateFeature (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at e.get (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at e.register (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at e.registerTensor (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at new e (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at Function.e.make (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at tensor (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at Module.tensor2d (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250) at eval (webpack-internal:///./node_modules/handtrackjs/src/index.js:131) at eval (webpack-internal:///./node_modules/@tensorflow/tfjs-core/dist/tf-core.esm.js:250)

Whereas in the old project everything works as expected. Both projects use the same handtrackjs version + same Vue version. Is there any hint what might cause this behaviour?

vincentwinkel commented 3 years ago

I have the same issue. Here is a component made quickly as test:

<template>
<canvas ref="canvas" style="background: green;"></canvas>
</template>
<script>
import Vue from 'vue';
import {
  Component
} from 'vue-property-decorator';
import * as handTrack from 'handtrackjs';

@Component({
  name: 'AirControl',
  data() {
    return {
      model: null
    };
  },
  async mounted() {
    this.model = await handTrack.load();
    console.log('model loaded');
  }
})
export default class AirControl extends Vue {}
</script>

Result: same error as the initial post. I don't even see the model loaded log message.

Note: I use tensorFlow 2.7.0.

vincentwinkel commented 3 years ago

Any update ?