WangA commited on
Commit
8d184e5
1 Parent(s): 7eb63ce

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
README.md CHANGED
@@ -30,10 +30,12 @@ loss = MarginRankingLoss(margin=1)
30
  0% of margin 相当于准确率
31
  ## 使用
32
  采用Pytorch加载,一般用加载一个CNN模型就可以使用,注意删除state_dict中的字典名字
33
- model_dict = torch.load('./checkpoint_5.pth')['state_dict']
 
34
  model_dict_mod = {}
35
  for key, value in model_dict.items():
36
  new_key = '.'.join(key.split('.')[1:])
37
  model_dict_mod[new_key] = value
38
  self.model.load_state_dict(model_dict_mod)
 
39
 
 
30
  0% of margin 相当于准确率
31
  ## 使用
32
  采用Pytorch加载,一般用加载一个CNN模型就可以使用,注意删除state_dict中的字典名字
33
+ ```
34
+ model_dict = torch.load('./checkpoint.pth')['state_dict']
35
  model_dict_mod = {}
36
  for key, value in model_dict.items():
37
  new_key = '.'.join(key.split('.')[1:])
38
  model_dict_mod[new_key] = value
39
  self.model.load_state_dict(model_dict_mod)
40
+ ```
41