Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch data from GitHub repo as JSON doesn't work #1485

Open
konvasil opened this issue Apr 26, 2024 · 1 comment
Open

Fetch data from GitHub repo as JSON doesn't work #1485

konvasil opened this issue Apr 26, 2024 · 1 comment

Comments

@konvasil
Copy link

konvasil commented Apr 26, 2024

I want to load some data from a JSON file which is stored in GitHub, the data is printed in Chrome's console as expected and as soon as is fetched but when I try to load it for the neural network with loadData(....) it doesn't work.

 //load data from GitHub
    if(key == 'f' && state == 'waiting') {
        const fetchPromise = fetch("myUrl")

        fetchPromise
            .then((response) => response.json())
            .then((raw) => {
                remoteLoad(raw)
            })
    }

function remoteLoad(data){
    console.log(options)
    brain.loadData(data, dataLoaded)
}

```


- **Web browser & version**:
- Chrome
- **Operating System**:
- MacOS Ventura
- **ml5 version you're using**:
- * Tone.js v14.7.77 *
@shiffman
Copy link
Member

shiffman commented May 3, 2024

Hi @konvasil, could you try using the newest ml5.js? https://github.com/ml5js/ml5-next-gen

Examples and Docs:
https://github.com/ml5js/ml5-next-gen/blob/main/documentation.md
https://editor.p5js.org/ml5/collections/pUzWMkdmE

If you still have errors, to help, I think we would need additional information, a link to a simplified sketch in the p5.js web editor would be most helpful. I would also suggest using p5.js preload() function to get the data to send to the neural network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants