Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion taming/modules/losses/lpips.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Stripped version of https://github.com/richzhang/PerceptualSimilarity/tree/master/models"""

import os
import torch
import torch.nn as nn
from torchvision import models
Expand All @@ -25,7 +26,7 @@ def __init__(self, use_dropout=True):
param.requires_grad = False

def load_from_pretrained(self, name="vgg_lpips"):
ckpt = get_ckpt_path(name, "taming/modules/autoencoder/lpips")
ckpt = get_ckpt_path(name, os.path.expanduser("~/.cache/taming/modules/autoencoder/lpips"))
self.load_state_dict(torch.load(ckpt, map_location=torch.device("cpu")), strict=False)
print("loaded pretrained LPIPS loss from {}".format(ckpt))

Expand Down