mfrashad / text2art

AI-powered Text-to-Art Generator - Text2Art.com
Other
778 stars 208 forks source link

Google Colab 'MyRandomPerspective' object has no attribute 'resample' #8

Closed oonacitarhan closed 2 years ago

oonacitarhan commented 2 years ago

Hi there,

When I try to run your Google Colab notebook, I got an error that says:


AttributeError Traceback (most recent call last)

in () 13 settings = clipit.apply_settings() 14 clipit.do_init(settings) ---> 15 clipit.do_run(settings) 11 frames /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in __getattr__(self, name) 1129 return modules[name] 1130 raise AttributeError("'{}' object has no attribute '{}'".format( -> 1131 type(self).__name__, name)) 1132 1133 def __setattr__(self, name: str, value: Union[Tensor, 'Module']) -> None: AttributeError: 'MyRandomPerspective' object has no attribute 'resample' Could you please help? Thanks!
youssef12347 commented 2 years ago

Same issue here.

hcorion commented 2 years ago

Go to line 226 in clipit/clipit.py and change it from

             mode=self.resample.name.lower(), align_corners=self.align_corners, padding_mode=global_padding_mode

to

             mode=self.flags["resample"].name.lower(), align_corners=self.flags["align_corners"], padding_mode=global_padding_mode

Alternatively you can change the install script in text2art.ipynb to install a specific version of kornia pip install kornia==0.6.1

oonacitarhan commented 2 years ago

It worked. Thanks a lot!

hcorion commented 2 years ago

Keep this open please, the issue is still a problem.