Closed adamdavidcole closed 1 year ago
For running with device='cpu'
, do you use use_cpu(G)
before generating the images? I have an example in generate.py
, see if this helps!
I would love to solve this problem myself if only I had an M1 chip. So in the meantime, I'll depend on your results (and others' input)!
Yea, I experimented with the use_cpu()
and the force_fp32()
options, but no luck.
The version of pytorch that runs on the M1 gpu is super new, so could be a bug on their side of things. I'll keep an eye on it and maybe it'll resolve itself in a future release 🤞
Curious to see if anyone else comes up with a workaround or solution though!
Hey! Any updates on the behavior in Mac with the latest updates from Pytorch? Closing this issue for the time being, but am very interested in any additional results.
Is your feature request related to a problem? Please describe. I'd like to be able to generate images using the Metal Performance Shaders (MPS) pytorch acceleration for M1 macs
Describe the solution you'd like Run the generate.py script with device=mps
Describe alternatives you've considered I've modified the code and am able to run the function, but the resulting image is completely gray. I'm curious if anyone else has tried and succeeded.
The issue seems to be in
w_to_img
->G.synthesis()
. The output of that function does not match the output when I run withdevice=cpu
. Up until that point everything matched (for example, the output ofget_w_from_seed
was correct withmps
).The code changes were:
Set device to mps if selected
Ensure float32 conversion, for example