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

OSX Install #105

Closed
ronag opened this issue Nov 25, 2022 · 5 comments
Closed

OSX Install #105

ronag opened this issue Nov 25, 2022 · 5 comments

Comments

@ronag
Copy link

ronag commented Nov 25, 2022

pip install imaginairy==6.0.0a0 --upgrade

Seems to require huggingface/transformers#2831 (comment)

But then:

/opt/homebrew/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: dlopen(/opt/homebrew/lib/python3.9/site-packages/torchvision/image.so, 0x0006): Symbol not found: (__ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEENS6_INS2_12MemoryFormatEEE)
  Referenced from: '/opt/homebrew/lib/python3.9/site-packages/torchvision/image.so'
  Expected in: '/opt/homebrew/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib'
  warn(f"Failed to load image Python extension: {e}")
Traceback (most recent call last):
  File "/opt/homebrew/bin/imagine", line 5, in <module>
    from imaginairy.cmds import imagine_cmd
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/__init__.py", line 7, in <module>
    from .api import imagine, imagine_image_files  # noqa
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/api.py", line 14, in <module>
    from imaginairy.enhancers.describe_image_blip import generate_caption
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/enhancers/describe_image_blip.py", line 13, in <module>
    device = get_device()
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/utils.py", line 22, in get_device
    if torch.backends.mps.is_available():
AttributeError: module 'torch.backends' has no attribute 'mps'
@brycedrennan
Copy link
Owner

Are you on an M1 laptop? what version of torch is installed?

@brycedrennan
Copy link
Owner

Closing until we get more information.

@ronag
Copy link
Author

ronag commented Nov 28, 2022

torch in /opt/homebrew/lib/python3.9/site-packages (1.11.0)

@ronag
Copy link
Author

ronag commented Nov 28, 2022

~$ imagine "a scenic landscape" "a photo of a dog" "photo of a fruit bowl" "portrait photo of a freckled woman"
/opt/homebrew/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: dlopen(/opt/homebrew/lib/python3.9/site-packages/torchvision/image.so, 0x0006): Symbol not found: (__ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEENS6_INS2_12MemoryFormatEEE)
  Referenced from: '/opt/homebrew/lib/python3.9/site-packages/torchvision/image.so'
  Expected in: '/opt/homebrew/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib'
  warn(f"Failed to load image Python extension: {e}")
Traceback (most recent call last):
  File "/opt/homebrew/bin/imagine", line 5, in <module>
    from imaginairy.cmds import imagine_cmd
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/__init__.py", line 7, in <module>
    from .api import imagine, imagine_image_files  # noqa
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/api.py", line 14, in <module>
    from imaginairy.enhancers.describe_image_blip import generate_caption
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/enhancers/describe_image_blip.py", line 13, in <module>
    device = get_device()
  File "/opt/homebrew/lib/python3.9/site-packages/imaginairy/utils.py", line 22, in get_device
    if torch.backends.mps.is_available():
AttributeError: module 'torch.backends' has no attribute 'mps'

@ronag
Copy link
Author

ronag commented Nov 28, 2022

I think I got it working with pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

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