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

Environment issue #246

Open
FrenkT opened this issue Aug 26, 2024 · 10 comments
Open

Environment issue #246

FrenkT opened this issue Aug 26, 2024 · 10 comments

Comments

@FrenkT
Copy link

FrenkT commented Aug 26, 2024

Hi all, thank you for developing the project, it's really great.

When I run on Intel Mac (./install-mac.sh and then ./start-webui.sh or ./start.sh) I get the following error:

Traceback (most recent call last):
  File "/Users/username/projects/fastsdcpu_2/src/app.py", line 8, in <module>
    from backend.upscale.tiled_upscale import generate_upscaled_image
  File "/Users/username/projects/fastsdcpu_2/src/backend/upscale/tiled_upscale.py", line 6, in <module>
    from context import Context
  File "/Users/username/projects/fastsdcpu_2/src/context.py", line 5, in <module>
    from backend.lcm_text_to_image import LCMTextToImage
  File "/Users/username/projects/fastsdcpu_2/src/backend/lcm_text_to_image.py", line 19, in <module>
    from backend.openvino.pipelines import (
  File "/Users/username/projects/fastsdcpu_2/src/backend/openvino/pipelines.py", line 9, in <module>
    from optimum.intel.openvino.modeling_diffusion import OVBaseModel
  File "/Users/username/projects/fastsdcpu_2/env/lib/python3.10/site-packages/optimum/intel/openvino/__init__.py", line 19, in <module>
    from .utils import (
  File "/Users/username/projects/fastsdcpu_2/env/lib/python3.10/site-packages/optimum/intel/openvino/utils.py", line 76, in <module>
    "u16": torch.uint16,
  File "/Users/username/projects/fastsdcpu_2/env/lib/python3.10/site-packages/torch/__init__.py", line 1938, in __getattr__
    raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
AttributeError: module 'torch' has no attribute 'uint16'

The only other report I found on this is this one, where they suggest upgrading torch. In fact, I managed to get FastSD CPU running by manually installing pytorch=2.4.0.

I didn't have a chance to try this on another OS, so not sure if this is specific of my environment or some other dependency that needs to be pinned.

@rupeshs
Copy link
Owner

rupeshs commented Aug 27, 2024

@FrenkT Thanks for reporting this

@maburu-keki
Copy link

@FrenkT may I ask you how you manually installed pytorch to get Fastsd cpu to work ?
I've had exactly the same issue when trying to run the desktop app or the web ui. (Macbook air with Intel cpu, Mac Os Big Sur)

@rupeshs
Copy link
Owner

rupeshs commented Sep 26, 2024

@FrenkT Have you tried the latest release?

@FrenkT
Copy link
Author

FrenkT commented Sep 28, 2024

@FrenkT Have you tried the latest release?

Hi @rupeshs, I just tried and I still have the error.

@FrenkT
Copy link
Author

FrenkT commented Sep 28, 2024

@FrenkT may I ask you how you manually installed pytorch to get Fastsd cpu to work ? I've had exactly the same issue when trying to run the desktop app or the web ui. (Macbook air with Intel cpu, Mac Os Big Sur)

@maburu-keki, here are the steps I followed, hope they work for you.

First of all, it looks like pytorch 2.4.0 is not available on Intel Mac via pip, so I had to go through conda, so:

  • Install miniconda: https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html
  • Create a python 3.11: conda create -n env python=3.11 and activate it: conda activate env
  • Install pytorch: conda install pytorch==2.4.0 torchvision -c pytorch and the other requirements: pip install -r requirements.txt
  • Ignore the start.sh script and run directly with python, e.g. python src/app.py --gui

@maburu-keki
Copy link

@FrenkT

I get this :

_PackagesNotFoundError: The following packages are not available from current channels:
pytorch==2.4.0

While The "pytorch" channel does have up to the latest stable version (2.5.0) for windows, linux and arm64 osx, it is stuck at version 2.2.2 for mac os x64 (Intel) :
https://anaconda.org/pytorch/pytorch

Should I use another channel ?
Thanks.

@maburu-keki
Copy link

@maburu-keki, here are the steps I followed, hope they work for you.

First of all, it looks like pytorch 2.4.0 is not available on Intel Mac via pip, so I had to go through conda, so:

* Install miniconda: https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html

* Create a python 3.11: `conda create -n env python=3.11` and activate it: `conda activate env`

* Install pytorch: `conda install pytorch==2.4.0 torchvision -c pytorch` and the other requirements: `pip install -r requirements.txt`

@FrenkT

I had to install pytorch (2.4.1) from the "conda-forge" channel

             conda install pytorch torchvision -c conda-forge

...as official pytorch binaries for Intel Macs are stopped (from 2.3.0 onwards)
@rupeshs : pytorch/pytorch#114602
https://dev-discuss.pytorch.org/t/pytorch-macos-x86-builds-deprecation-starting-january-2024/1690

* Ignore the `start.sh` script and run directly with python, e.g. `python src/app.py --gui`

It got stuck at the command line : no gui window popping, nothing happening at all, for about a minute.
And then :

                   zsh: segmentation fault  python src/app.py --gui

@rupeshs Your app doesn't work at all on Intel Macs running mac os Big Sur.

@FrenkT
Copy link
Author

FrenkT commented Oct 20, 2024

@maburu-keki
I tried following again my instructions and they work for me, so I am not sure on what's going on your side as I can't reproduce your issue.
It might be that I am on MacOS Sequoia, while you are on Big Sur, which is quite a few releases old.

@maburu-keki
Copy link

@maburu-keki It might be that I am on MacOS Sequoia, while you are on Big Sur, which is quite a few releases old.

Most definitely.
But not being able to run the app on an intel macbook air, just because it happens to be on mac os Big Sur, kind of defeats the whole purpose of the project, doesn't it.

I wish I had the latest Mac Os but my mac being a few years (too) old, Apple won't let me upgrade beyond Big Sur.

@mkarliner
Copy link

I have the same problem here on Monterey. could you please changed the title of the issue to 'PyTorch on Mac uint16 or similar, I only found this issue by accident. I'll try the conda route.

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

5 participants
@mkarliner @rupeshs @FrenkT @maburu-keki and others