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

TypeError: no_grad.__init__() on import #12

Closed
jhlchu opened this issue Feb 6, 2024 · 3 comments
Closed

TypeError: no_grad.__init__() on import #12

jhlchu opened this issue Feb 6, 2024 · 3 comments

Comments

@jhlchu
Copy link

jhlchu commented Feb 6, 2024

Trying to import from segmoe import SegMoEPipeline, throws:

File "C:\Users\xyz\AppData\Roaming\Python\Python310\site-packages\segmoe\main.py", line 89, in <module>
  class SegMoEPipeline:
File "C:\Users\xyz\AppData\Roaming\Python\Python310\site-packages\segmoe\main.py", line 1260, in SegMoEPipeline
  def get_hidden_states(self, model, positive, negative, average: bool = True):
TypeError: no_grad.__init__() takes 1 positional argument but 2 were given
@Warlord-K
Copy link
Contributor

Warlord-K commented Feb 6, 2024

Could you please check that you are using the latest versions of diffusers, transformers and torch?

@jhlchu
Copy link
Author

jhlchu commented Feb 19, 2024

I couldn't update torch because of another program's dependency. Ended up installing segmoe in venv instead, that worked.

@jhlchu jhlchu closed this as completed Feb 19, 2024
@SatMa34
Copy link

SatMa34 commented Feb 27, 2024

I couldn't update torch because of another program's dependency. Ended up installing segmoe in venv instead, that worked.

i wonder which version of torch, transformers and diffusers you are using? i faced the same problem, and my env is: torch==2.0.1, transformers==4.38.1, diffusers==0.26.3

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

3 participants