Error in Sample(): Expected scalar type float but found double
See original GitHub issueWhen running the example code, I keep getting the following error (see below). Do you have any idea how to fix it?
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_21777/4126247202.py in <module>
44 # do the above for many steps, then ...
45
---> 46 video = phenaki.sample(text = 'a squirrel examines an acorn', num_frames = 17, cond_scale = 5.) # (1, 3, 17, 256, 256)
47
48 # so in the paper, they do not really achieve 2 minutes of coherent video
~/Phenaki/phenaki-pytorch/phenaki_pytorch2/phenaki_pytorch2.py in inner(model, *args, **kwargs)
36 was_training = model.training
37 model.eval()
---> 38 out = fn(model, *args, **kwargs)
39 model.train(was_training)
40 return out
/opt/conda/lib/python3.7/site-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
26 def decorate_context(*args, **kwargs):
27 with self.__class__():
---> 28 return func(*args, **kwargs)
29 return cast(F, decorate_context)
30
~/Phenaki/phenaki-pytorch/phenaki_pytorch2/phenaki_pytorch2.py in sample(self, text, num_frames, prime_frames, cond_scale, starting_temperature, noise_K)
1115 scores = 1 - rearrange(scores, '... 1 -> ...')
1116
-> 1117 scores = torch.where(mask, scores, -1e4)
1118
1119 if has_prime:
RuntimeError: expected scalar type float but found double
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
RuntimeError: Expected object of scalar type Float but got ...
When the error is RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #4 'mat1' , you would...
Read more >RuntimeError: Expected object of scalar type Double but got ...
Expected scalar type Double but found Float ... A fix would be to call .double() for convert to 64bit float.
Read more >RuntimeError: expected scalar type Double but found Float #998
I created the following code: However, I get an error. I appreciate it if anyone can rune my code and let me know...
Read more >runtimeerror: expected scalar type float but found double torch
The error at line loss = criterion(outputs, labels) is quite clear in that it requites your datatype to be float rather than double,...
Read more >expected scalar type Half but found Float" when using fp16
Here is a code snippet that causes the error. import torch from diffusers import StableDiffusionPipeline TOKEN = 'hugging_face_token' # get your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gmegh oh that is recent, maybe i should downgrade and fix the root issue
supporting rectangular sized video is actually possible with this architecture! let me put it in my todos
are you a phd student at Stanford?
I had 1.10, i believe
Regarding training, how can videos of different shapes be inputted into the model? I try adding a video with frames of size (300, 620) and it didn’t work because it expects the video to have dimension image_size