报错:
RuntimeError: CUDA error: out of memory
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA
to enable device-side assertions.
Sentry is attempting to send 1 pending events
Waiting up to 2 seconds
Press Ctrl-C to quit
**解决:**在运行代码最上面加上这几句
import os
os.environ[‘CUDA_VISIBLE_DEVICES’]=‘7’