如果指定非CUDA:0 就会报错 cuda设备不一致的问题。 RuntimeError: Expected all tensors to be on the same device, but got index is on cuda:6, different from other tensors on cuda:0 (when checking argument in method wrapper_CUDA__index_select) ^CKeyboard interruption in main thread... closing server.
查找原因:model:698self.inference_model.device=0 这里的self.inference_model没有到指定设备上 强制设置可见cuda设备可解决 os.environ["CUDA_VISIBLE_DEVICES"] = "7"
配置常量DEVICE = "cuda:0"