zaidalyafeai / ml-projects

Implementation of web friendly ML models using TensorFlow.js. pix2pix, face segmentation, fast style transfer and many more ...
MIT License
647 stars 254 forks source link

"TypeError: tf.loadModel is not a function" on TEXter page #24

Open josephrocca opened 4 years ago

josephrocca commented 4 years ago

Just a heads up that I'm getting this error on Chrome 79:

image

on this page: https://zaidalyafeai.github.io/texter/

Looks similar to this issue: https://github.com/zaidalyafeai/zaidalyafeai.github.io/issues/17

zaidalyafeai commented 4 years ago

@josephrocca can you please open a PR if you fixed the error ?

josephrocca commented 4 years ago

Looks like you just need to be careful about using @latest on the end of your jsdelivr CDN urls, because that will jump up semver major versions (which can have breaking changes). I haven't tried fixing, sorry - was just passing by and noticed that it was broken. But should be a simple change like in #17 (tf.loadLayersModel and tf.browser.toPixels).

You can use a specific version of tf.js fron the cdn to prevent this sort of thing happening again when tf.js goes to v2.0:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0/dist/tf.min.js"></script>