英文:
eras conversion to ONNX
问题
I have my trained keras model and I am trying to convert it into ONNX format to use it in Unity but I constantly get errors anyone could help:
import tensorflow.keras as keras
import onnx
import keras2onnx
model = keras.models.load_model('b_model.h5')
onnx_model = keras2onnx.convert.convert(model, model.name)
onnx.save_model(onnx_model, 'onnx_model.onnx')
The error is as follow: AttributeError: module 'tensorflow.python.keras' has no attribute 'applications' I have all installations updated etc.
英文:
I have my trained keras model and I am trying to convert it into ONNX format to use it in Unity but I constantly get errors anyone could help:
`import tensorflow.keras as keras
import onnx
import keras2onnx
model = keras.models.load_model('b_model.h5')
onnx_model = keras2onnx.convert.convert(model, model.name)
onnx.save_model(onnx_model, 'onnx_model.onnx')`
The error is as follow: AttributeError: module 'tensorflow.python.keras' has no attribute 'applications' I have all installations updated etc
答案1
得分: 0
Keras2onnx 已被弃用。
请使用 tf2onnx。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论