gantman / learn-tfjs Goto Github PK
View Code? Open in Web Editor NEWThe code for the book Learning TensorFlow.js by Gant Laborde - Published by O'Reilly Media
Home Page: https://infinite.red/learn-tensorflowjs
The code for the book Learning TensorFlow.js by Gant Laborde - Published by O'Reilly Media
Home Page: https://infinite.red/learn-tensorflowjs
Today I did gh repo clone GantMan/learn-tfjs
I did npm i
at chapter2/web/web-toxicity
http://localhost:1234/ shows : Uncaught (in promise) TypeError: forwardFunc is not a function
This not TFJS specific - I'm trying to get this running via deno - not nodejs, so no node_modules.
import tfjs from "https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js";
import * as toxicity from "https://cdn.jsdelivr.net/npm/@tensorflow-models/[email protected]";
const threshold = 0.5;
toxicity.load(threshold).then((model: any) =>
{
//
});
I get :
error: TS2339 [ERROR]: Property 'load' does not exist on type 'typeof import("https://cdn.jsdelivr.net/npm/@tensorflow-models/[email protected]")'.
Does anyone have any issues running this now ?
Some errorTypeError: forwardFunc_1 is not a function
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
Just tried to test the Chapter 2 examples: double clicked the first web/index.html.
Check the console: that prints out the error: "Uncaught SyntaxError: Cannot use import statement outside a module"
When trying to install node dependencies, specifically concerning tfjs-node
, there seems to be an issue. This may be specific to my system, as I'm running Apple silicon, but essentially what happens is when the install script attempts to download the pre built binaries from https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz it gets the following error:
node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz
this eventually results in more errors as the build script attempts to build tensorflow.
what's strange is this file doesn't even exist in the directory @ https://storage.googleapis.com/tf-builds, and and there are zero darwin specific builds in for napi-v8
(the latest is napi-v7/3.6.1
for both CPU and GPU), so i'm unsure why the script is using the build above.
i'm wondering if i should be using a specific arm64 build of node for Apple Silicon or if tfjs-node
is even compilable natively on Apple silicon currently?
also happy to provide my full logs if it helps troubleshoot this issue.
Aren't you creating a new rank 2 Tensor filled with 1 everywhere instead of copying and shading an existing dice ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.