改成语义分割 segnet 后,训练正常,但是在剪枝时,报错如下。
”C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\cuda\IndexKernel.cu:93: block: [2,0,0], thread: [126,0,0]
Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds"
failed.
C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\cuda\IndexKernel.cu:93: block: [2,0,0], thread: [127,0,0]
Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds"
failed.
Traceback (most recent call last):
File "d:/code/pytorch-slimming/pytorch-slimming/prune.py", line 149, in
torch.save({'state_dict': newmodel.state_dict()}, args.save)
File "E:\Anaconda3\envs\segnet\lib\site-packages\torch\serialization.py", line 379, in save
_save(obj, opened_zipfile, pickle_module, pickle_protocol)
File "E:\Anaconda3\envs\segnet\lib\site-packages\torch\serialization.py", line 496, in save
storage = storage.cpu()
File "E:\Anaconda3\envs\segnet\lib\site-packages\torch\storage.py", line 72, in cpu
return self.type(getattr(torch, self.class.name))
File "E:\Anaconda3\envs\segnet\lib\site-packages\torch\cuda_init.py", line 618, in type
return super(_CudaBase, self).type(*args, **kwargs) # type: ignore[misc]
File "E:\Anaconda3\envs\segnet\lib\site-packages\torch_utils.py", line 45, in type
return dtype(self.size()).copy(self, non_blocking)
RuntimeError: CUDA error: device-side assert triggered
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.“