I'm getting started with react native and there's a problem I'm facing when trying to import a custom PyTorch lite model using require function
. Here's the syntax from an example typescript file:
const model = require('./models/mobilenet_v3_small.ptl');
The problem is that this throws file not found error when building the app using yarn android
. This file was added after I built the app once. I'm not sure if that's has anything to do with the error. I also noticed that even the VS code file explorer widget didn't read these model files that were added later.
In the above image, you can see only json files are read. But here's the actual contents of the folder.
All of the .plt files were added later. Why is this happening? After reading multiple answers and cross-checking with the example, I think the syntax is correct.