Report on Attempts to Launch the CCSR Project on a MacBook with M1 Chip
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:
- 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.
- 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.
- 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.
- 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:
- 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.
- 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:
- 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?
- Is there support for MPS (Mac M1)?
- I’m using MPS for inference. Could the missing modules be related to M1 chip support?
- 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.
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.