最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ios - How to handle tflite model to prevent "Phase Script Execution Failed" error in React Native App (Not Exp

programmeradmin5浏览0评论

The beginning of the app.tsx file for my react native app looks like this:

import {PaintStyle, Skia} from '@shopify/react-native-skia';
import React, {useEffect} from 'react';
import {StyleSheet, Text} from 'react-native';
import {
  Camera,
  useCameraDevice,
  useCameraPermission,
  VisionCameraProxy,
  Frame,
  useSkiaFrameProcessor,
} from 'react-native-vision-camera';
import { useTensorflowModel } from 'react-native-fast-tflite';
import RNFS from 'react-native-fs';

const plugin = VisionCameraProxy.initFrameProcessorPlugin('myPlugin', {});

it works perfectly this way. I have built the app and downloaded it to my iPhone using XCode and it builds perfectly. However, when I try to use a tensorflow model I have imported by adding the line: const modelPlugin = useTensorflowModel(require('../assets/model.tflite')); I get a "Phase Script Execution Failed with nonzero exit code" error from xcode and the build is not completed. I suspect the issue is with where the model is in my folder hierarchy even though I did exactly as directed on the react-native-fast-tflite github. Do I need to somehow save it as a Target in XCode or something? Any help is greatly appreciated.

I have isolated the issue to be the line: const modelPlugin = useTensorflowModel(require('../assets/model.tflite'));

Without it, the app builds. With it, there is an error. I have tried saving the model in the ios folder through XCode and adding it as a target, but this had no effect.

发布评论

评论列表(0)

  1. 暂无评论