Skip to content

What is the error "Clashing resolution for expression. 1=1 != 8."? #1464

Answered by kali
barakugav asked this question in Q&A
Discussion options

You must be logged in to vote

There is something I dont get with the error formatting here. Tract error uses anyhow, so the contexts usually stack and are displayed in the Debug form. Unless this is a case where there is just no context specificied in the code, but it will be difficult to find from here without the model.

You need to use ONNX "dynamic axes" to export your model with a flexible batch size. In some cases, you can also "fix" this inside tract after loading the model, before calling into_optimized().

let mut model = tract_onnx::onnx().model_for_path(model_path)?;
let batch = model.symbol_table.sym("batch");
model.set_input_fact(0, f32::fact(dims!(batch, 3, 224, 224)).into())?
let model = model.into_optimi…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@barakugav
Comment options

@kali
Comment options

kali Jul 3, 2024
Maintainer

Answer selected by barakugav
@barakugav
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants