question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install imaginairy==6.0.0a0 --upgrade

Seems to require https://github.com/huggingface/transformers/issues/2831#issuecomment-1001437376

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'

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ronagcommented, 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

0reactions
ronagcommented, 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'
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to download macOS - Apple Support
Open your Applications folder and double-click the macOS installer, named Install [ Version Name ]. Follow the onscreen instructions to install ...
Read more >
Reinstalling OS X on your Mac - NO LONGER IN USE
Install macOS · Choose Reinstall macOS (or Reinstall OS X) from the utilities window. · Click Continue, then follow the onscreen instructions. You'll...
Read more >
How to Install macOS High Sierra - iFixit Repair Guide
1. With the device powered off, disconnect any external hard drives and flash drives. 2. Your Mac will begin copying the installation files...
Read more >
How to clean install macOS on your Mac - Macworld
1. We're going to re-download the installer file for our chosen version of macOS and store it on a USB stick or external...
Read more >
How to install older versions of macOS or OS X - Macworld
How to install older versions of macOS or OS X ; Start up your Mac and immediately hold down Command + R. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found