CCSR icon indicating copy to clipboard operation
CCSR copied to clipboard

Report on Attempts to Launch the CCSR Project on a MacBook with M1 Chip

Open 321LFG opened this issue 1 year ago • 1 comments

System Description: Laptop Model: MacBook Pro Processor: Apple M1 OS: macOS 11 Python: 3.9 (Miniconda environment) Pytorch: 2.4.1 with MPS support Torchvision: 0.19.1 Pytorch Lightning: 1.7.7 Pip version: 23.0.1

Steps Taken:

  1. Environment Setup and Dependency Installation
  • Created a Python environment using Miniconda.

  • Installed PyTorch with MPS support via the command: pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --extra-index-url https://download.pytorch.org/whl/mps

  • Installed the project dependencies using: pip install -r requirements.txt

  • Encountered version conflicts with pytorch-lightning due to metadata issues. This was resolved by installing pytorch-lightning==1.7.7 after downgrading pip to version 23.0.1.

  1. Issue with Missing mac_specific.py File
  • When running the gradio_ccsr.py script (and other scripts like inference_ccsr.py), the following error appeared: ModuleNotFoundError: No module named 'modules.mac_specific'
  • After investigation, I found that the file mac_specific.py does not exist in the repository, although it is imported in utils/devices.py. The modules folder is present, but this specific file is missing.
  1. Model Weights Handling
  • The model weight real-world_ccsr.ckpt was successfully downloaded and placed in the weights directory.
  • The inference script starts, but fails due to the missing mac_specific.py file.
  1. Inference Configuration
  • I followed the instructions and tried running the test script with the appropriate parameters, but ran into the aforementioned issue with the missing file.

Example inference command: python inference_ccsr.py
--input preset/test_datasets
--config configs/model/ccsr_stage2.yaml
--ckpt weights/real-world_ccsr-001.ckpt
--steps 45
--sr_scale 4
--t_max 0.6667
--t_min 0.3333
--color_fix_type adain
--output experiments/test
--device mps
--repeat_times 1

Main Challenges:

  1. Missing mac_specific.py Module
  • Error: ModuleNotFoundError: No module named 'modules.mac_specific'.
  • The repository lacks the mac_specific.py file, which is imported in several scripts.
  • I attempted to locate the file using the command: find . -name "mac_specific.py" but it was not found.
  1. Integration with M1 (Apple Silicon)
  • I am using MPS (Metal Performance Shaders) as the device for inference, and I am wondering whether the missing modules are related to the M1 chip and its support for MPS.

Questions:

  1. What should be done about the missing mac_specific.py file?
  • Was this file removed or replaced? Can it be safely removed from the imports, or should it be replaced with other logic?
  • If the file is no longer necessary, is it safe to simply remove the import statement?
  1. Is there support for MPS (Mac M1)?
  • I’m using MPS for inference. Could the missing modules be related to M1 chip support?
  1. Could you provide any recommendations for next steps?
  • What is the correct way to run this project on a MacBook with an M1 chip?

Any help or guidance would be greatly appreciated! Thanks for your project, and I hope for your assistance in resolving this issue.

321LFG avatar Sep 21 '24 16:09 321LFG

Thank you for your report. Could you first try commenting out or removing the import of mac_specific.py to see if it affects the execution? If the issue persists, you can try adding the mac_specific.py from Stable Diffusion WebUI to the corresponding code location.

csslc avatar Dec 12 '24 04:12 csslc