Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native tensorflow型号/mobilenet在设备脱机时不工作_React Native_Tensorflow.js - Fatal编程技术网

React native tensorflow型号/mobilenet在设备脱机时不工作

React native tensorflow型号/mobilenet在设备脱机时不工作,react-native,tensorflow.js,React Native,Tensorflow.js,我使用tensorflow models/mobilenet作为我自己的应用程序。 当有网络时,应用程序运行良好。但当设备离线时,在IOS应用程序上它不会加载模型 async function predictMobilenet() { try { setTextshow(' LOADING...') var start = new Date().getTime(); console.log(' Load m

我使用tensorflow models/mobilenet作为我自己的应用程序。 当有网络时,应用程序运行良好。但当设备离线时,在IOS应用程序上它不会加载模型

 async function predictMobilenet() {
        try {
            setTextshow(' LOADING...')
            var start = new Date().getTime();
            console.log(' Load model...')
            //const tfReady = await tf.ready();
            const tfReady = await tf.ready();
            console.log('Uffect load model')
            const model = await mobilenet.load();
            const imgB64 = await FileSystem.readAsStringAsync(selectedImage.localUri, {
                encoding: FileSystem.EncodingType.Base64,
            });
            const imgBuffer = tf.util.encodeString(imgB64, 'base64').buffer;
            const raw = new Uint8Array(imgBuffer)
            const imageTensor = decodeJpeg(raw);
            const prediction = await model.classify(imageTensor);
            var end = new Date().getTime();
            var time = end - start;
            setTextshow(JSON.stringify(prediction))
            setTime(time)
        }catch (e) {
            setTextshow(e.toString())
            console.log(e)
        }
    }



code line: const model = await mobilenet.load(); not working on ios when device offline

iOS上的错误:

error : network request failed. 
但在Android上,我的应用程序运行良好