Comments (1)
你好,我用下载的 h5 模型,用 tensorflow lite convertor 转化为 tflite 模型时报错。命令和 log 如下,请问您知道是什么原因吗?
(用的是tensorflow 2.2.0版本)命令:
tflite_convert --output_file='/.../models/foo.tflite' --keras_model_file='/.../models/github_yeyupiaoling_resnet50.h5'log:
"invalid shape '{1}'.".format(_get_tensor_name(tensor), shape_list))
ValueError: None is only supported in the 1st dimension. Tensor 'resnet50v2_input' has invalid shape '[None, 128, None, 1]'.
import tensorflow as tf
saved_model_dir = 'models'
model = tf.saved_model.load(saved_model_dir)
concrete_func = model.signatures[tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY]
concrete_func.inputs[0].set_shape([1, 128, 128, 1])
converter = tf.lite.TFLiteConverter.from_concrete_functions([concrete_func])
tflite_model = converter.convert()
open('model', 'wb').write(tflite_model)
from audioclassification-tensorflow.
Related Issues (5)
- 如何对小于3秒的数据进行训练? HOT 28
- 数据集下载失败 HOT 3
- tensorflow 2.0训练过程转换成1.x HOT 3
- input_shape
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audioclassification-tensorflow.