RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:74
在别的多卡机器上训练时指定了显卡
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
那么在新的机器上测试时,尽管只有一块显卡,也要指定显卡
os.environ["CUDA_VISIBLE_DEVICES"] = "1"