eras 转换为 ONNX

huangapple go评论69阅读模式
英文:

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

英文:

Keras2onnx is deprected.

Please use tf2onnx

huangapple
  • 本文由 发表于 2023年5月15日 15:15:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76251686.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定