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

AttributeError: module 'segmentation_models_pytorch' has no attribute 'utils' #24

Closed
trproto opened this issue Oct 11, 2022 · 1 comment

Comments

@trproto
Copy link

trproto commented Oct 11, 2022

After following the install instructions and running the main.py script as instructed both locally and in colab...

os.chdir(path)
!python -W ignore main.py --style ./imgs/style-1.png --input ./imgs/non-makeup.png

I get the following error:

Traceback (most recent call last):
File "main.py", line 28, in
model = Makeup(args)
File "/content/gdrive/.shortcut-targets-by-id/1rZyAvaAtqZ9a0okVcv4OFaq9aiVvKg5Q/CPM/makeup.py", line 18, in init
self.pattern = Segmentor(args)
File "/content/gdrive/.shortcut-targets-by-id/1rZyAvaAtqZ9a0okVcv4OFaq9aiVvKg5Q/CPM/utils/models.py", line 15, in init
self.loss = smp.utils.losses.DiceLoss()
AttributeError: module 'segmentation_models_pytorch' has no attribute 'utils'

@trproto
Copy link
Author

trproto commented Oct 11, 2022

In enviroment.yml change line 169:

  • segmentation-models-pytorch

to

  • segmentation-models-pytorch==0.2

then reinstall environment.

@trproto trproto closed this as completed Oct 11, 2022
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

1 participant