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

Compile Error due to a type mismatch #568

Open
Mostafa86 opened this issue Apr 20, 2024 · 2 comments
Open

Compile Error due to a type mismatch #568

Mostafa86 opened this issue Apr 20, 2024 · 2 comments

Comments

@Mostafa86
Copy link

I am getting the following error

(CompileError) deps/axon/lib/axon/loop.ex:469: the do-block in while must return tensors with the same shape, type, and names as the initial arguments.

While trying to enforce the following policy

policy = Axon.MixedPrecision.create_policy( params: {:f, 64}, compute: {:f, 64}, output: {:f, 64} )

The error seems to be due to the gradient_state below initiated as :f32

gradient_state: zeros_like(model_state, type: :f32),

@seanmor5
Copy link
Contributor

Ah yeah the gradient state needs to match the policy. I will look into this. In the mean time is there a reason you need f64 specifically?

@Mostafa86
Copy link
Author

@seanmor5 Thanks 👍

Regarding f64, not really it is just an error that I came across while trying to hunt down the reason behind a NaN in one of the models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants