progrock-stable icon indicating copy to clipboard operation
progrock-stable copied to clipboard

AttributeError: module 'torch.backends' has no attribute 'mps'

Open tarinhaig opened this issue 2 years ago • 1 comments

After following the installation instructions, and running 'python prs.py', the following error occurrs:

(prs) >:~/stablediffusion/prs$ python prs.py

PROG ROCK STABLE
----------------

Parsing settings.json
Applying settings file: settings.json
Using k_lms sampling method.
Loading the model and checkpoint (./models/sd-v1-4.ckpt)...
Loading model from ./models/sd-v1-4.ckpt
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Downloading: 100%|█████████████████████████| 4.41k/4.41k [00:00<00:00, 4.82MB/s]
Traceback (most recent call last):
  File "prs.py", line 1067, in <module>
    main()
  File "prs.py", line 946, in main
    elif ("mps" in cl_args.device) or (torch.backends.mps.is_available()):
AttributeError: module 'torch.backends' has no attribute 'mps'

Steps to reproduce:

  1. git clone https://github.com/lowfuel/progrock-stable prs
  2. cd prs
  3. conda env create -f environment.yaml
  4. conda activate prs
  5. python prs.py

Environment:

  • Ubuntu 22.04 LTS
  • AWS c5d.2xlarge image

tarinhaig avatar Sep 10 '22 12:09 tarinhaig

"mps" referes to the Apple M1 GPU device on MacOS, so it didn't work on Ubuntu 22.04 LTS👀

l1jiahao avatar Oct 29 '22 06:10 l1jiahao