VinAIResearch / CPM

💄 Lipstick ain't enough: Beyond Color-Matching for In-the-Wild Makeup Transfer (CVPR 2021)
https://thaoshibe.github.io/CPM
Apache License 2.0
367 stars 58 forks source link

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

Closed trproto closed 1 year ago

trproto commented 1 year ago

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 commented 1 year ago

In enviroment.yml change line 169:

  • segmentation-models-pytorch

to

  • segmentation-models-pytorch==0.2

then reinstall environment.