Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ident cannot be a number; use Literal instead #2324

Open
samolego opened this issue Sep 30, 2024 · 0 comments
Open

Ident cannot be a number; use Literal instead #2324

samolego opened this issue Sep 30, 2024 · 0 comments
Labels

Comments

@samolego
Copy link

Describe the bug
When I try to convert the buffalo_l.onnx face recognition model, the build.rs panics with the error:

  ERROR burn_import::logger: PANIC => panicked at /home/samoh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/burn-import-0.14.0/src/burn/ty.rs:92:19:
  Ident cannot be a number; use Literal instead    

To Reproduce
Download buffalo_l from https://huggingface.co/immich-app/buffalo_l/blob/main/detection/model.onnx

Use the following in build.rs

    ModelGen::new()
        .input(model_path)
        .out_dir("model.onnx")
        .run_from_script();

Expected behavior
I suspect

pub fn new<S: AsRef<str>>(name: S, kind: ScalarKind) -> Self {
if name.as_ref().is_empty() {
panic!("Scalar of Type {:?} was passed with empty name", kind);
}
Self {
name: Ident::new(name.as_ref(), Span::call_site()),
kind,
}
}
should wrap the name, similar to fn TensorType::format_name, as otherwise this error can be thrown.

Desktop:

  • Device: Laptop
  • OS: Fedora 40

Additional context

@laggui laggui added the onnx label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants