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

Apple Silicon support? #12

Open
banagale opened this issue Oct 31, 2022 · 6 comments
Open

Apple Silicon support? #12

banagale opened this issue Oct 31, 2022 · 6 comments

Comments

@banagale
Copy link

Does your project run on Apple Silicon hardware? I wasn't sure if the hardware requirements rule out particular configurations.

I looked at your installation instructions and here in issues but didn't see mention of AS / M1 etc.

@carefree0910
Copy link
Owner

carefree0910 commented Oct 31, 2022

It should be able to install, but whether it can run or not is actually depending on PyTorch, not this project, because I'm just running PyTorch models and hope for the best 😆.

Someone kindly enough on HN has already tried the following commands and succeeded in installing:

git clone https://github.com/carefree0910/carefree-creator
cd carefree-creator
pip3 install carefree-client carefree-learn carefree-cv ftfy regex lmdb albumentations kafka-python redis[hiredis] cos-python-sdk-v5 uvicorn torchvision
python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123

@all4five
Copy link

all4five commented Nov 21, 2022

I'm trying to install it right now.

git clone https://github.com/carefree0910/carefree-creator
cd carefree-creator
pip3 install carefree-client carefree-learn carefree-cv ftfy regex lmdb albumentations kafka-python redis[hiredis] cos-python-sdk-v5 uvicorn torchvision
python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123

Did not work but … this :

git clone https://github.com/carefree0910/carefree-creator
cd carefree-creator
pip3 install carefree-client carefree-learn
pip3 install lmdb
pip3 install albumentations
pip3 install kafka-python 
pip3 install redis
pip3 install cos-python-sdk-v5 
pip3 install uvicorn
pip3 install torchvision
python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123

…somehow did. Be aware I had to switch "pip3 install redis[hiredis]" to "pip3 install redis"

Currently it's downloading:
clip.large: 1.71GB [09:12, 3.09MB/s]
kl.f8: 405MB [01:57, 3.45MB/s]
ldm.sd:

Can you tell me where these are installed? I couldn't find them in the carefree-creator folder.

Update:

it failed sadly

 python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123
/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: dlopen(/Users/XXXXXX/miniconda3/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: '/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torchvision/image.so'
  Expected in: '/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib'
  warn(f"Failed to load image Python extension: {e}")

@carefree0910
Copy link
Owner

@all4five Hi! The models are downloaded at ~/.cache/carefree-learn/models.

And your error message indicates that there's something wrong with the pytorch installation... 😣

I had tried to install this project on my m1 mac, and it turns out that I can only use CPU to generate images, which usually takes minutes to get a 512*512 one. 🤣

So maybe a better option for m1 users is to use the Google Colab! 😉

@TreeZhou
Copy link

I run the project with ‘cfcreator serve --save_gpu_ram’,but it still emit error with 'AssertionError: Torch not compiled with CUDA enabled'. like the picture below. Can you help me ?
image
image

@carefree0910
Copy link
Owner

carefree0910 commented Feb 15, 2023

Ah, my bad, i should actually introduce a flag called --cpu for mac. 🤣
let me develop it for a while, and i'll notify you once i finished! 😉 @TreeZhou

@carefree0910
Copy link
Owner

carefree0910 commented Feb 16, 2023

@TreeZhou Hi! Now you can play this project on mac with --cpu flag:

cfcreator serve --cpu

But it will be REALLY slow to generate an image (~12s/it on my m1, which means it will take 3min33s to generate an image with 20 steps. 🤣)

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

4 participants