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

Example "text2img-example.py" not working #78

Closed
Thytu opened this issue Oct 28, 2022 · 6 comments · Fixed by #82
Closed

Example "text2img-example.py" not working #78

Thytu opened this issue Oct 28, 2022 · 6 comments · Fixed by #82

Comments

@Thytu
Copy link
Contributor

Thytu commented Oct 28, 2022

When running text2img-example.py I encounter the following error message :

raise ValueError(f"model must be a torch.nn.Module, got {type(self.module)}"

It's raised from

mii.deploy(task='text-to-image',
               model="CompVis/stable-diffusion-v1-4",
               deployment_name="sd_deploy",
               mii_config=mii_configs)

Is "CompVis/stable-diffusion-v1-4" still handled?

Installed packages
asyncio==3.4.3
certifi @ file:///croot/certifi_1665076670883/work/certifi
charset-normalizer==2.1.1
deepspeed==0.7.3
deepspeed-mii==0.0.2
diffusers==0.6.0
filelock==3.8.0
grpcio==1.50.0
grpcio-tools==1.50.0
hjson==3.1.0
huggingface-hub==0.10.1
idna==3.4
importlib-metadata==5.0.0
ninja==1.10.2.4
numpy==1.23.4
packaging==21.3
Pillow==9.2.0
protobuf==4.21.9
psutil==5.9.3
py-cpuinfo==9.0.0
pydantic==1.10.2
pyparsing==3.0.9
PyYAML==6.0
regex==2022.9.13
requests==2.28.1
six==1.16.0
tokenizers==0.12.1
torch==1.13.0+cu116
torchaudio==0.13.0+cu116
torchvision==0.14.0+cu116
tqdm==4.64.1
transformers==4.21.2
typing_extensions==4.4.0
urllib3==1.26.12
zipp==3.10.0
@Thytu
Copy link
Contributor Author

Thytu commented Oct 28, 2022

Note : This issue still occurs when using the updated code from this PR.

@mrwyattii
Copy link
Contributor

mrwyattii commented Oct 28, 2022

Hi @Thytu, I just tested the example and it's working for me. It looks like you have DeepSpeed v0.7.3 installed. Stable Diffusion injection policies were only recently added, and you will need to install v0.7.5 v0.7.4 or latest source:
pip install deepspeed==0.7.5 pip install deepspeed==0.7.4 or pip install git+https://github.com/microsoft/deepspeed.git

Let me know if that resolves the error.

@jeffra thanks for the correction

@jeffra
Copy link
Contributor

jeffra commented Oct 28, 2022

Thanks for trying this @Thytu. Small clarification here, the min version for SD is 0.7.4 which is the latest released to PyPI (https://pypi.org/project/deepspeed/0.7.4/). I'll update the min requirements for MII in an upcoming PR.

@Thytu
Copy link
Contributor Author

Thytu commented Oct 29, 2022

Still encountering error with the requirement updated. To avoid further errors related to any dependencies, I suggested this feature request.

@mrwyattii
Copy link
Contributor

@Thytu what error are you seeing after updating DeepSpeed? Also, are you providing the hf_auth_token in the mii_config from the example?

@Thytu
Copy link
Contributor Author

Thytu commented Nov 2, 2022

@Thytu what error are you seeing after updating DeepSpeed?

My bad I answered here.

Also, are you providing the hf_auth_token in the mii_config from the example?

Yep 👌

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

Successfully merging a pull request may close this issue.

3 participants