运行反应本机应用程序时收到错误消息。
Unable to resolve "./tfjs_model_to_use_quantized/content/tfjs_model_to_use/group1-shard1of1.bin" from "components\ImageInput.js"
我试图在我的 JS 代码中导入一个名为 group1-shardof1.bin 的文件。
其他 require 函数(例如,对于 json 文件)工作正常,并且此特定 require 函数的文件路径是正确的。我认为问题在于 .bin 扩展名不支持在反应本机代码中导出:
const modelWeights = require('./tfjs_model_to_use_quantized/content/tfjs_model_to_use/group1-shard1of1.bin')
我已经尝试过,我补充说:
"packagerOpts": {
"assetExts": ["bin", "pb", "txt"]
}
在我的 app.json 中,带有 bin 扩展名。
如何配置我的 react-native 应用程序以便能够将 .bin 文件扩展名导入 JS 文件?如果有人可以帮助我解决这个问题,那就太好了。
守着星空守着你
相关分类