edward2021 commited on
Commit
1ad306d
1 Parent(s): f75b1b0

change map location to cpu

Browse files
Files changed (1) hide show
  1. pq3d/inference.py +1 -1
pq3d/inference.py CHANGED
@@ -169,7 +169,7 @@ def inference(scan_id, text):
169
  data_dict.update(tokenize_txt(text))
170
  data_dict = form_batch(data_dict)
171
  model = Query3DUnified()
172
- load_msg = model.load_state_dict(torch.load(os.path.join(CKPT_DIR, 'pytorch_model.bin')), strict=False)
173
  data_dict = model(data_dict)
174
  result_id = data_dict['obj_ids'][0][torch.argmax(data_dict['og3d_logits'][0]).item()]
175
  print(f"finish infernece result id is {result_id}")
 
169
  data_dict.update(tokenize_txt(text))
170
  data_dict = form_batch(data_dict)
171
  model = Query3DUnified()
172
+ load_msg = model.load_state_dict(torch.load(os.path.join(CKPT_DIR, 'pytorch_model.bin'), map_location='cpu'), strict=False)
173
  data_dict = model(data_dict)
174
  result_id = data_dict['obj_ids'][0][torch.argmax(data_dict['og3d_logits'][0]).item()]
175
  print(f"finish infernece result id is {result_id}")