转换RIFE模型到onnx再转换到tensorfow失败
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 131
- PR merge metrics
- No merged PRs in 30d
Description
一、转换代码如下:
onnx_path = 'flownet.onnx'
dummy_input = torch.randn(1, 6, 256, 448).to(device)
torch.onnx.export(self.flownet,
dummy_input,
onnx_path,
export_params=True,
opset_version=16,
do_constant_folding=True,
input_names = ['input'],
output_names = ['output'],
)
print(f'Model has been exported to {onnx_path}')
onnx_model = onnx.load(onnx_path)
tf_rep = prepare(onnx_model)
tf_rep.export_graph("flownet.pb")
## 加载 SavedModel
model = tf.saved_model.load("flownet.pb")
二、报错如下:
BackendIsNotSupposedToImplementIt: LeakyRelu version 16 is not implemented.
如果opset_version设置11则提示grid_sample要opset_version 16
或者请问下能不能提供Tf或者tflite的预训练模型?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown torch.onnx.export call with opset 16, then run onnx_tf.prepare on flownet.onnx and inspect the LeakyRelu backend error alongside the grid_sample requirement. Done would mean establishing a compatible conversion path or clearly determining whether a TensorFlow or TFLite pretrained model can be provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100