MeYourHint commited on
Commit
9193de0
1 Parent(s): a21a43a
models/mask_transformer/transformer.py CHANGED
@@ -179,7 +179,7 @@ class MaskTransformer(nn.Module):
179
  clip_model, clip_preprocess = clip.load(clip_version, device='cpu',
180
  jit=False) # Must set jit=False for training
181
  # Cannot run on cpu
182
- if str(self.device) != "cpu":
183
  clip.model.convert_weights(
184
  clip_model) # Actually this line is unnecessary since clip by default already on float16
185
  # Date 0707: It's necessary, only unecessary when load directly to gpu. Disable if need to run on cpu
@@ -732,7 +732,7 @@ class ResidualTransformer(nn.Module):
732
  clip_model, clip_preprocess = clip.load(clip_version, device='cpu',
733
  jit=False) # Must set jit=False for training
734
  # Cannot run on cpu
735
- if str(self.device) != "cpu":
736
  clip.model.convert_weights(
737
  clip_model) # Actually this line is unnecessary since clip by default already on float16
738
  # Date 0707: It's necessary, only unecessary when load directly to gpu. Disable if need to run on cpu
 
179
  clip_model, clip_preprocess = clip.load(clip_version, device='cpu',
180
  jit=False) # Must set jit=False for training
181
  # Cannot run on cpu
182
+ if str(self.opt.device) != "cpu":
183
  clip.model.convert_weights(
184
  clip_model) # Actually this line is unnecessary since clip by default already on float16
185
  # Date 0707: It's necessary, only unecessary when load directly to gpu. Disable if need to run on cpu
 
732
  clip_model, clip_preprocess = clip.load(clip_version, device='cpu',
733
  jit=False) # Must set jit=False for training
734
  # Cannot run on cpu
735
+ if str(self.opt.device) != "cpu":
736
  clip.model.convert_weights(
737
  clip_model) # Actually this line is unnecessary since clip by default already on float16
738
  # Date 0707: It's necessary, only unecessary when load directly to gpu. Disable if need to run on cpu