This commit is contained in:
wataru 2023-04-14 15:20:28 +09:00
parent 42da74d557
commit bb769cf6c2

View File

@ -111,7 +111,7 @@ def export2onnx(input_model, output_model, output_model_simple, is_half):
except: except:
is_half = False is_half = False
dev = torch.device("cpu") dev = torch.device("cpu")
net_g_onnx.eval().to(dev).float() net_g_onnx.eval().to(dev)
net_g_onnx.load_state_dict(cpt["weight"], strict=False) net_g_onnx.load_state_dict(cpt["weight"], strict=False)
if is_half: if is_half:
@ -119,7 +119,7 @@ def export2onnx(input_model, output_model, output_model_simple, is_half):
net_g_onnx = net_g_onnx.half() net_g_onnx = net_g_onnx.half()
else: else:
print("!!!!!!!!!!!!!!!!!! full") print("!!!!!!!!!!!!!!!!!! full")
net_g_onnx = net_g_onnx.full() net_g_onnx = net_g_onnx.float()
if is_half: if is_half:
feats = torch.HalfTensor(1, 2192, 256).to(dev) feats = torch.HalfTensor(1, 2192, 256).to(dev)