Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
File reference in Chrome extension

I would like to load a model in contentScript.js using url './model/model.json'

const MODEL_URL = './model/model.json';
const model = tf.loadLayersModel(MODEL_URL);

but keep getting Request to model/model.json failed with status code 404. Please verify this URL points to the model JSON of the model to load. Could not figure out what went wrong. I also tried '../model/model.json', 'model/model.json', './model/model' et. al..

├── build
│   ├── icons
│   │   ├── ...
│   ├── model
│   │   ├──model.json
│   ├── contentScript.js

Update:

Added "web_accessible_resources": [ "models/*" ] to manifest.json, still get 404.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use getURL():

tf.loadLayersModel(chrome.runtime.getURL(MODEL_URL));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!