magenta / magenta-js

Magenta.js: Music and Art Generation with Machine Learning in the browser
https://magenta.tensorflow.org
Apache License 2.0
1.96k stars 311 forks source link

"TypeError: Only absolute URLs are supported" & "Only HTTP(S) protocols are supported" #661

Open jjannone opened 1 year ago

jjannone commented 1 year ago

Having downloaded models using checkpoint_downloader.py, I am attempting to load them locally.

As suggested in #576 I prepended file:// and get the error Only HTTP(S) protocols are supported

As suggested in #470 I used /modelName and continue to get the error Only absolute URLs are supported

Any other suggestions?

notwaldorf commented 1 year ago

Could you post your code? It's hard to tell what's going on otherwise.

jjannone commented 1 year ago
const musicvae = require('@magenta/music/node/music_vae');
const core = require('@magenta/music/node/core');
const Max = require('max-api');

var modelCheckPoint = 'https://storage.googleapis.com/magentadata/js/checkpoints/music_vae/mel_2bar_small'; //works

//////// fails with Only HTTP(S) protocols are supported ////////
//var modelCheckPoint = 'file://Users/johnjannone/Dropbox/_Projects__________________/_MAX/Magenta/drums_2bar_lokl_small';

//////// fails with Only absolute URLs are supported ////////
//var modelCheckPoint = '/drums_2bar_lokl_small';
//var modelCheckPoint = 'file:///Users/johnjannone/Dropbox/_Projects__________________/_MAX/Magenta/drums_2bar_lokl_small';

var MusicVAE = new musicvae.MusicVAE(modelCheckPoint);
MusicVAE.initialize()
    .then(function(MusicVAE) { 

     Max.post('MusicVAE initialized with model '+modelCheckPoint);

    });
jackm357 commented 1 year ago

I am having this exact same problem.