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

Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind' #7

Open
system1system2 opened this issue Dec 4, 2022 · 2 comments

Comments

@system1system2
Copy link

system1system2 commented Dec 4, 2022

I'm trying this extension for the latest A1111 commit on a MBP M1 with SD2 768 model. Accordingly, the following flags are used to start the system:
--skip-torch-cuda-test --no-half --use-cpu interrogate

torch==1.12.1
torchvision==0.13.1

Everything works fine in the system, but the heatmap doesn't get generated. A1111 returns the following error:

numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'

@kousw
Copy link
Owner

kousw commented Dec 4, 2022

I don't have an M1 Mac, so I don't know the details. But it worked on CPU.
Do you know where the error is in more detail?

@system1system2
Copy link
Author

This is the full output:

File "/Users/UserName/Desktop/stable-diffusion-webui/modules/script_callbacks.py", line 121, in before_image_saved_callback
c.callback(params)
File "/Users/UserName/Desktop/stable-diffusion-webui/extensions/stable-diffusion-webui-daam/scripts/daam_script.py", line 207, in handle_before_image_saved
before_image_saved_handler(params)
File "/Users/UserName/Desktop/stable-diffusion-webui/extensions/stable-diffusion-webui-daam/scripts/daam_script.py", line 108, in
before_image_saved_handler = lambda params : self.before_image_saved(params)
File "/Users/UserName/Desktop/stable-diffusion-webui/extensions/stable-diffusion-webui-daam/scripts/daam_script.py", line 162, in before_image_saved
global_heat_map = self.tracer.compute_global_heat_map(styled_prompot, batch_pos)
File "/Users/UserName/Desktop/stable-diffusion-webui/extensions/stable-diffusion-webui-daam/scripts/daam/trace.py", line 142, in compute_global_heat_map
time_weights = [1.0] * len(self.forward_hook.all_heat_maps)
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'

This article talks about the error:
https://techoverflow.net/2019/05/22/how-to-fix-numpy-typeerror-cannot-cast-ufunc-subtract-output-from-dtypefloat64-to-dtypeint64-with-casting-rule-same_kind/

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