Browse Source

修改测试代码

liyan 1 year ago
parent
commit
e4629f3f43
3 changed files with 43 additions and 2 deletions
  1. 40 0
      secret_func.py
  2. 2 1
      train.py
  3. 1 1
      val.py

File diff suppressed because it is too large
+ 40 - 0
secret_func.py


+ 2 - 1
train.py

@@ -10,9 +10,10 @@ import torchvision.transforms as transforms
 from matplotlib import pyplot as plt
 from torch import optim
 from tqdm import tqdm  # 导入tqdm
+
+import secret_func
 from model.Alexnet import Alexnet
 from watermark_codec import ModelEncoder
-from watermark_codec.tool import secret_func
 
 # 参数
 batch_size = 500

+ 1 - 1
val.py

@@ -9,7 +9,7 @@ import torchvision.transforms as transforms
 
 from model.Alexnet import Alexnet
 from watermark_codec import ModelDecoder
-from watermark_codec.tool import secret_func
+import secret_func
 
 model_path = './run/train/alex_net.pt'
 key_path = './run/train/key.pt'