nadermx / backgroundremover

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.
https://www.backgroundremoverai.com
MIT License
6.69k stars 556 forks source link

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

Closed DNucX closed 9 months ago

DNucX commented 10 months ago

Hello,

First I would like to thank you for the awesome background removing tool!

Recently I upgraded from version 0.1.9 to the latest. After the upgrade was done, I attempted to remove a background from an image and got the following error:

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

Fortunately I was able to reinstall/downgrade back to version 0.1.9 again and everything worked after that. I would like though to keep up to date with the background remover upgrades.

If the above error can be corrected, that would be great. Thank you!

DNucX commented 9 months ago

Hi @nadermx,

This is the error I'm now getting when attempting to use version 0.2.6:

Traceback (most recent call last):
  File "bgRemover1/bin/backgroundremover", line 5, in <module>
    from backgroundremover.cmd.cli import main
  File "/home/user/pythonProjects/bgRemover1/lib/python3.6/site-packages/backgroundremover/cmd/cli.py", line 4, in <module>
    from .. import utilities
  File "/home/user/pythonProjects/bgRemover1/lib/python3.6/site-packages/backgroundremover/utilities.py", line 9, in <module>
    from .bg import DEVICE, Net, iter_frames, remove_many
  File "/home/user/pythonProjects/bgRemover1/lib/python3.6/site-packages/backgroundremover/bg.py", line 21, in <module>
    elif torch.backends.mps.is_available():
AttributeError: module 'torch.backends' has no attribute 'mps'