GithubHelp home page GithubHelp logo

gantman / learn-tfjs Goto Github PK

View Code? Open in Web Editor NEW
183.0 7.0 83.0 137.34 MB

The code for the book Learning TensorFlow.js by Gant Laborde - Published by O'Reilly Media

Home Page: https://infinite.red/learn-tensorflowjs

HTML 44.40% JavaScript 41.96% CSS 0.76% TypeScript 12.88%
hacktoberfest machine-learning tensorflow tensorflow-tutorials tensorflowjs tensorflowjs-tutorial

learn-tfjs's Issues

How do we run this on deno ?

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]")'.

NodeJS sample code returning errorTypeError

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 */);

Cannot use import statement outside a module

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"

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.