TypeError: no_grad.__init__() on import
jhlchu opened this issue · 3 comments
jhlchu commented
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 commented
Could you please check that you are using the latest versions of diffusers, transformers and torch?
jhlchu commented
I couldn't update torch because of another program's dependency. Ended up installing segmoe
in venv
instead, that worked.
SatMa34 commented
I couldn't update torch because of another program's dependency. Ended up installing
segmoe
invenv
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