Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教 想要自己训练动作,但最后生成tflite时报错 #23

Open
shankaijie opened this issue Nov 23, 2022 · 1 comment
Open

Comments

@shankaijie
Copy link

想要自己训练一些动作,编译大佬的文件报错

报错位置:
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()

报错信息:Some of the operators in the model are not supported by the standard TensorFlow Lite runtime. If those are native TensorFlow operators, you might be able to use the extended runtime by passing --enable_select_tf_ops, or by setting target_ops=TFLITE_BUILTINS,SELECT_TF_OPS when calling tf.lite.TFLiteConverter(). Otherwise, if you have a custom implementation for them you can disable this error with --allow_custom_ops, or by setting allow_custom_ops=True when calling tf.lite.TFLiteConverter(). Here is a list of builtin operators you are using: ADD, DIV, EXPAND_DIMS, FLOOR_DIV, FULLY_CONNECTED, GATHER, MAXIMUM, MUL, PACK, REDUCE_MAX, RESHAPE, SOFTMAX, SQRT, SQUEEZE, STRIDED_SLICE, SUB, SUM. Here is a list of operators for which you will need custom implementations: BroadcastTo, Size.

需要增加 这句: converter.allow_custom_ops=True

得到最终:16:23converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.allow_custom_ops=True
tflite_model = converter.convert()

这样编译通过了 但是得到的tflite的文件运行到AS上面跑不通,想知道up主为什么不需要加就能编译通过

@18335076880
Copy link

请问一下您的utils里的utils中的'visualize'内容是什么啊

AttributeError Traceback (most recent call last)
in
10 )
11
---> 12 preprocessor.process(per_pose_class_limit=None
in process(self, per_pose_class_limit, detection_threshold)
111
112 # Draw the prediction result on top of the image for debugging later
--> 113 output_overlay = draw_prediction_on_image(
114 image.numpy().astype(np.uint8), person,
115 close_figure=True, keep_input_size=True)

in draw_prediction_on_image(image, person, crop_region, close_figure, keep_input_size)
18 """
19 # Draw the detection result on top of the image.
---> 20 image_np = utils.visualize(image, [person])
21
22 # Plot the image with detection results.

AttributeError: module 'utils' has no attribute 'visualize'
我报错了,找不到这个visualize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants